Make it impossible to log in with the ghost user

This commit is contained in:
Daniel Hougaard
2024-02-22 05:00:25 +01:00
parent 8e13eb6077
commit 6dcab6646c
+1 -1
View File
@@ -23,7 +23,7 @@ export const userDALFactory = (db: TDbClient) => {
const findUserEncKeyByEmail = async (email: string) => { const findUserEncKeyByEmail = async (email: string) => {
try { try {
return await db(TableName.Users) return await db(TableName.Users)
.where({ email }) .where({ email, ghost: false })
.join(TableName.UserEncryptionKey, `${TableName.Users}.id`, `${TableName.UserEncryptionKey}.userId`) .join(TableName.UserEncryptionKey, `${TableName.Users}.id`, `${TableName.UserEncryptionKey}.userId`)
.first(); .first();
} catch (error) { } catch (error) {