mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
chore: remove userEmail to email
This commit is contained in:
@@ -7,7 +7,7 @@ export async function up(db: Kysely<any>): Promise<void> {
|
|||||||
"token" bytea NOT NULL,
|
"token" bytea NOT NULL,
|
||||||
"oauthSub" varchar NOT NULL,
|
"oauthSub" varchar NOT NULL,
|
||||||
"oauthSid" varchar,
|
"oauthSid" varchar,
|
||||||
"userEmail" varchar NOT NULL,
|
"email" varchar NOT NULL,
|
||||||
"expiresAt" timestamp with time zone NOT NULL,
|
"expiresAt" timestamp with time zone NOT NULL,
|
||||||
"createdAt" timestamp with time zone NOT NULL DEFAULT now()
|
"createdAt" timestamp with time zone NOT NULL DEFAULT now()
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export class OAuthLinkTokenTable {
|
|||||||
oauthSid!: string | null;
|
oauthSid!: string | null;
|
||||||
|
|
||||||
@Column()
|
@Column()
|
||||||
userEmail!: string;
|
email!: string;
|
||||||
|
|
||||||
@Column({ type: 'timestamp with time zone' })
|
@Column({ type: 'timestamp with time zone' })
|
||||||
expiresAt!: Timestamp;
|
expiresAt!: Timestamp;
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ describe(AuthService.name, () => {
|
|||||||
id: 'token-id',
|
id: 'token-id',
|
||||||
oauthSub: 'oauth-sub-123',
|
oauthSub: 'oauth-sub-123',
|
||||||
oauthSid: null,
|
oauthSid: null,
|
||||||
userEmail: user.email,
|
email: user.email,
|
||||||
token: Buffer.from('hashed'),
|
token: Buffer.from('hashed'),
|
||||||
expiresAt: new Date(Date.now() + 600_000),
|
expiresAt: new Date(Date.now() + 600_000),
|
||||||
createdAt: new Date(),
|
createdAt: new Date(),
|
||||||
@@ -120,7 +120,7 @@ describe(AuthService.name, () => {
|
|||||||
id: 'token-id',
|
id: 'token-id',
|
||||||
oauthSub: 'oauth-sub-123',
|
oauthSub: 'oauth-sub-123',
|
||||||
oauthSid: 'idp-sid-456',
|
oauthSid: 'idp-sid-456',
|
||||||
userEmail: user.email,
|
email: user.email,
|
||||||
token: Buffer.from('hashed'),
|
token: Buffer.from('hashed'),
|
||||||
expiresAt: new Date(Date.now() + 600_000),
|
expiresAt: new Date(Date.now() + 600_000),
|
||||||
createdAt: new Date(),
|
createdAt: new Date(),
|
||||||
|
|||||||
@@ -356,7 +356,7 @@ export class AuthService extends BaseService {
|
|||||||
token: hashedToken,
|
token: hashedToken,
|
||||||
oauthSub: profile.sub,
|
oauthSub: profile.sub,
|
||||||
oauthSid: oauthSid ?? null,
|
oauthSid: oauthSid ?? null,
|
||||||
userEmail: emailUser.email,
|
email: emailUser.email,
|
||||||
expiresAt: DateTime.now().plus({ minutes: 10 }).toJSDate(),
|
expiresAt: DateTime.now().plus({ minutes: 10 }).toJSDate(),
|
||||||
});
|
});
|
||||||
throw new OAuthLinkRequiredException(emailUser.email, plainToken);
|
throw new OAuthLinkRequiredException(emailUser.email, plainToken);
|
||||||
|
|||||||
Reference in New Issue
Block a user