mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Only check existense of user password when using password auth
Fixes #3831
This commit is contained in:
@@ -46,12 +46,14 @@ export class AuthenticationService {
|
||||
throw new InvalidCredentialsException();
|
||||
}
|
||||
|
||||
if (!password || !user.password) {
|
||||
throw new InvalidCredentialsException();
|
||||
}
|
||||
if (password !== undefined) {
|
||||
if (!user.password) {
|
||||
throw new InvalidCredentialsException();
|
||||
}
|
||||
|
||||
if (password !== undefined && (await argon2.verify(user.password, password)) === false) {
|
||||
throw new InvalidCredentialsException();
|
||||
if ((await argon2.verify(user.password, password)) === false) {
|
||||
throw new InvalidCredentialsException();
|
||||
}
|
||||
}
|
||||
|
||||
if (user.tfa_secret && !otp) {
|
||||
|
||||
Reference in New Issue
Block a user