diff --git a/src/auth/models/MagicLink.ts b/src/auth/models/MagicLink.ts index c531af1..90b45b0 100644 --- a/src/auth/models/MagicLink.ts +++ b/src/auth/models/MagicLink.ts @@ -116,7 +116,7 @@ export default class MagicLink extends Model implements AuthProof { public getExpirationDate(): Date { if (!this.generated_at) return new Date(); - return new Date(this.generated_at?.getTime() + MagicLink.validityPeriod()); + return new Date(this.generated_at.getTime() + MagicLink.validityPeriod()); } public authorize() { diff --git a/src/auth/models/UserEmail.ts b/src/auth/models/UserEmail.ts index be2cc30..4717eec 100644 --- a/src/auth/models/UserEmail.ts +++ b/src/auth/models/UserEmail.ts @@ -20,8 +20,8 @@ export default class UserEmail extends Model { } public user_id?: number; - public email?: string; - private main?: boolean; + public readonly email!: string; + private main!: boolean; public created_at?: Date; private wasSetToMain: boolean = false;