Merge pull request #1131 from gradido/bugfix_register_with_not_activ_account

Since we don't make a request to the login_server we need to catch if…
This commit is contained in:
Hannes Heine 2021-11-24 05:56:13 +01:00 committed by GitHub
commit cd7c70ee9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -207,6 +207,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()) {