Update messages

This commit is contained in:
Julian Gassner
2025-02-05 16:48:57 +00:00
parent 5d2a76adfe
commit 34194e65d2
5 changed files with 26 additions and 11 deletions

View File

@@ -30,10 +30,11 @@ module.exports = {
.where('user_id', userId)
.first()
.then((auth) => {
console.log(auth);
if (!auth) {
throw new error.AuthError('User not found.');
}
return auth.mfa_enabled === 1;
return auth.mfa_enabled === true;
});
},
createMfaSecretForUser: (userId) => {
@@ -68,7 +69,7 @@ module.exports = {
return authModel
.query()
.where('user_id', userId)
.update({ mfa_enabled: 1 })
.update({ mfa_enabled: true })
.then(() => true);
});
},