From e2cb3220018f1f903dad09b4ef05a7107afe8093 Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Sun, 14 Jun 2020 11:41:44 +0200 Subject: [PATCH] Fix some models properties --- src/auth/models/MagicLink.ts | 2 +- src/auth/models/UserEmail.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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;