aboutsummaryrefslogtreecommitdiffstats
path: root/packages/trpc/models/users.ts
diff options
context:
space:
mode:
authorMohamed Bassem <me@mbassem.com>2025-11-17 01:42:43 +0000
committerMohamed Bassem <me@mbassem.com>2025-11-17 01:42:43 +0000
commit815e1961701e13c933c3975c6026c60d1ded3cdf (patch)
treeb88921d5cc37720fb3a3c1654417fce3fa0f6f02 /packages/trpc/models/users.ts
parent88c73e212c4510ce41ad8c6557fa7d5c8f72d199 (diff)
downloadkarakeep-815e1961701e13c933c3975c6026c60d1ded3cdf.tar.zst
refactor: remove the PrivacyAware interface
Diffstat (limited to 'packages/trpc/models/users.ts')
-rw-r--r--packages/trpc/models/users.ts12
1 files changed, 1 insertions, 11 deletions
diff --git a/packages/trpc/models/users.ts b/packages/trpc/models/users.ts
index 7e6be7a5..97b062f0 100644
--- a/packages/trpc/models/users.ts
+++ b/packages/trpc/models/users.ts
@@ -31,9 +31,8 @@ import {
import { AuthedContext, Context } from "..";
import { generatePasswordSalt, hashPassword, validatePassword } from "../auth";
import { sendPasswordResetEmail, sendVerificationEmail } from "../email";
-import { PrivacyAware } from "./privacy";
-export class User implements PrivacyAware {
+export class User {
constructor(
protected ctx: AuthedContext,
public user: typeof users.$inferSelect,
@@ -355,15 +354,6 @@ export class User implements PrivacyAware {
.where(eq(passwordResetTokens.token, input.token));
}
- ensureCanAccess(ctx: AuthedContext): void {
- if (this.user.id !== ctx.user.id) {
- throw new TRPCError({
- code: "FORBIDDEN",
- message: "User is not allowed to access resource",
- });
- }
- }
-
private static async deleteInternal(db: Context["db"], userId: string) {
const res = await db.delete(users).where(eq(users.id, userId));