From e583e3c55ac3e3d2e2082eb92cc7bb90a9aa5d40 Mon Sep 17 00:00:00 2001 From: bo0tzz Date: Sat, 18 Apr 2026 17:28:21 +0200 Subject: [PATCH] chore: remove userEmail to email --- .../migrations/1776362646907-CreateOAuthLinkTokenTable.ts | 2 +- server/src/schema/tables/oauth-link-token.table.ts | 2 +- server/src/services/auth.service.spec.ts | 4 ++-- server/src/services/auth.service.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/server/src/schema/migrations/1776362646907-CreateOAuthLinkTokenTable.ts b/server/src/schema/migrations/1776362646907-CreateOAuthLinkTokenTable.ts index e732cda4b0..36b9ed1945 100644 --- a/server/src/schema/migrations/1776362646907-CreateOAuthLinkTokenTable.ts +++ b/server/src/schema/migrations/1776362646907-CreateOAuthLinkTokenTable.ts @@ -7,7 +7,7 @@ export async function up(db: Kysely): Promise { "token" bytea NOT NULL, "oauthSub" varchar NOT NULL, "oauthSid" varchar, - "userEmail" varchar NOT NULL, + "email" varchar NOT NULL, "expiresAt" timestamp with time zone NOT NULL, "createdAt" timestamp with time zone NOT NULL DEFAULT now() ); diff --git a/server/src/schema/tables/oauth-link-token.table.ts b/server/src/schema/tables/oauth-link-token.table.ts index 60e9c0d414..2477c0391d 100644 --- a/server/src/schema/tables/oauth-link-token.table.ts +++ b/server/src/schema/tables/oauth-link-token.table.ts @@ -15,7 +15,7 @@ export class OAuthLinkTokenTable { oauthSid!: string | null; @Column() - userEmail!: string; + email!: string; @Column({ type: 'timestamp with time zone' }) expiresAt!: Timestamp; diff --git a/server/src/services/auth.service.spec.ts b/server/src/services/auth.service.spec.ts index 963ece6c46..52dabb0009 100644 --- a/server/src/services/auth.service.spec.ts +++ b/server/src/services/auth.service.spec.ts @@ -98,7 +98,7 @@ describe(AuthService.name, () => { id: 'token-id', oauthSub: 'oauth-sub-123', oauthSid: null, - userEmail: user.email, + email: user.email, token: Buffer.from('hashed'), expiresAt: new Date(Date.now() + 600_000), createdAt: new Date(), @@ -120,7 +120,7 @@ describe(AuthService.name, () => { id: 'token-id', oauthSub: 'oauth-sub-123', oauthSid: 'idp-sid-456', - userEmail: user.email, + email: user.email, token: Buffer.from('hashed'), expiresAt: new Date(Date.now() + 600_000), createdAt: new Date(), diff --git a/server/src/services/auth.service.ts b/server/src/services/auth.service.ts index 2eb895dbbc..e6799ee460 100644 --- a/server/src/services/auth.service.ts +++ b/server/src/services/auth.service.ts @@ -356,7 +356,7 @@ export class AuthService extends BaseService { token: hashedToken, oauthSub: profile.sub, oauthSid: oauthSid ?? null, - userEmail: emailUser.email, + email: emailUser.email, expiresAt: DateTime.now().plus({ minutes: 10 }).toJSDate(), }); throw new OAuthLinkRequiredException(emailUser.email, plainToken);