Allow ghost users to skip 2fa
This commit is contained in:
@@ -17,7 +17,7 @@ function login(req, res, next) {
|
||||
|
||||
var ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress || null;
|
||||
|
||||
if (user.twoFactorAuthenticationEnabled) {
|
||||
if (!user.ghost && user.twoFactorAuthenticationEnabled) {
|
||||
if (!req.body.totpToken) return next(new HttpError(401, 'A totpToken must be provided'));
|
||||
|
||||
let verified = speakeasy.totp.verify({ secret: user.twoFactorAuthenticationSecret, encoding: 'base32', token: req.body.totpToken });
|
||||
|
||||
Reference in New Issue
Block a user