This commit is contained in:
parent
5a36fabf05
commit
11b54d66af
|
@ -40,14 +40,11 @@ module.exports = Self => {
|
|||
const validCredentials = vnUser
|
||||
&& await vnUser.hasPassword(password);
|
||||
|
||||
if (!validCredentials)
|
||||
throw new UserError('Invalid credentials');
|
||||
|
||||
if (!vnUser.active)
|
||||
throw new UserError('User disabled');
|
||||
|
||||
await Self.sendTwoFactor(ctx, vnUser, myOptions);
|
||||
await Self.passExpired(vnUser, myOptions);
|
||||
if (validCredentials) {
|
||||
if (!vnUser.active)
|
||||
throw new UserError('User disabled');
|
||||
await Self.sendTwoFactor(ctx, vnUser, myOptions);
|
||||
await Self.passExpired(vnUser, myOptions);
|
||||
|
||||
if (vnUser.twoFactor)
|
||||
throw new ForbiddenError(null, 'REQUIRES_2FA');
|
||||
|
|
Loading…
Reference in New Issue