From 56f47830758ff8e92abcfcc5f35d474ab12fe215 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 5 Oct 2022 15:37:15 +0200 Subject: Support two factor authentication in backend --- server/models/user/user.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'server/models') diff --git a/server/models/user/user.ts b/server/models/user/user.ts index 1a7c84390..34329580b 100644 --- a/server/models/user/user.ts +++ b/server/models/user/user.ts @@ -403,6 +403,11 @@ export class UserModel extends Model>> { @Column lastLoginDate: Date + @AllowNull(true) + @Default(null) + @Column + otpSecret: string + @CreatedAt createdAt: Date @@ -935,7 +940,9 @@ export class UserModel extends Model>> { pluginAuth: this.pluginAuth, - lastLoginDate: this.lastLoginDate + lastLoginDate: this.lastLoginDate, + + twoFactorEnabled: !!this.otpSecret } if (parameters.withAdminFlags) { -- cgit v1.2.3