Merge branch 'bugfix_register_with_not_activ_account' into login_call_resetPassword

This commit is contained in:
Ulf Gebhardt 2021-11-24 02:16:31 +01:00
commit d5ea64d9ca
Signed by: ulfgebhardt
GPG Key ID: DA6B843E748679C9

View File

@ -160,6 +160,7 @@ export class UserResolver {
const loginUser = await loginUserRepository.findByEmail(email).catch(() => {
throw new Error('No user with this credentials')
})
if (!loginUser.emailChecked) throw new Error('user email not validated')
const passwordHash = SecretKeyCryptographyCreateKey(email, password) // return short and long hash
const loginUserPassword = BigInt(loginUser.password.toString())
if (loginUserPassword !== passwordHash[0].readBigUInt64LE()) {