Skip to content

Commit

Permalink
Error if 2FA Key provided but not required. Close #25
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaneMcC committed Nov 11, 2018
1 parent ee6d2be commit 9af5db8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions web/1.0/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,10 @@ function getKnownDevice($user, &$context) {
$errorExtraData = '2FA key required.';
$resp->setHeader('login_error', '2fa_required');
}
} else if (empty($keys) && isset($_SERVER['HTTP_X_2FA_KEY'])) {
$errorExtraData = '2FA key provided but not required.';
$resp->setHeader('login_error', '2fa_notrequired');
$valid = false;
}

if ($valid) {
Expand Down

0 comments on commit 9af5db8

Please sign in to comment.