File tree 2 files changed +4
-8
lines changed
2 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -322,12 +322,10 @@ let Model = {
322
322
// Check OTP
323
323
let checkOTPResult = false ;
324
324
if ( Boolean ( OTP ) && typeof OTP === "string" && OTP . length > 0 ) {
325
- if ( await OneTimePassword . check ( login , OTP ) ) {
326
- checkOTPResult = true ;
327
- }
325
+ checkOTPResult = await OneTimePassword . check ( login , OTP ) ;
328
326
}
329
327
// When password required and LOGIN_OTP_REQUIRED you should pass both
330
- if ( await Settings . get ( "LOGIN_OTP_REQUIRED" ) && ! checkOTPResult && passwordPolicy === "required" )
328
+ if ( await Settings . get ( "LOGIN_OTP_REQUIRED" ) && ! checkOTPResult )
331
329
throw `login OTP check failed` ;
332
330
// When password is disabled Login possibly only by OTP
333
331
if ( passwordPolicy === "disabled" && ! checkOTPResult )
Original file line number Diff line number Diff line change @@ -355,13 +355,11 @@ let Model = {
355
355
// Check OTP
356
356
let checkOTPResult = false ;
357
357
if ( Boolean ( OTP ) && typeof OTP === "string" && OTP . length > 0 ) {
358
- if ( await OneTimePassword . check ( login , OTP ) ) {
359
- checkOTPResult = true
360
- }
358
+ checkOTPResult = await OneTimePassword . check ( login , OTP )
361
359
}
362
360
363
361
// When password required and LOGIN_OTP_REQUIRED you should pass both
364
- if ( await Settings . get ( "LOGIN_OTP_REQUIRED" ) && ! checkOTPResult && passwordPolicy === "required" ) throw `login OTP check failed`
362
+ if ( await Settings . get ( "LOGIN_OTP_REQUIRED" ) && ! checkOTPResult ) throw `login OTP check failed`
365
363
366
364
// When password is disabled Login possibly only by OTP
367
365
if ( passwordPolicy === "disabled" && ! checkOTPResult ) throw `Password policy [disabled] (OTP check failed)`
You can’t perform that action at this time.
0 commit comments