[Web] Fix U2F authentication, fixes #3468

master
andryyy 2020-04-13 09:36:51 +02:00
parent ce6d6a01f3
commit 942ddcc212
No known key found for this signature in database
GPG Key ID: 8EC34FF2794E25EF
1 changed files with 40 additions and 36 deletions

View File

@ -235,7 +235,6 @@ if (isset($_SESSION['mailcow_cc_role']) || isset($_SESSION['pending_mailcow_cc_u
));
exit();
}
if (!isset($_SESSION['pending_mailcow_cc_username'])) {
switch ($category) {
case "u2f-registration":
header('Content-Type: application/javascript');
@ -247,6 +246,7 @@ if (isset($_SESSION['mailcow_cc_role']) || isset($_SESSION['pending_mailcow_cc_u
echo 'var registeredKeys = ' . json_encode($sigs) . ';';
echo 'var appId = req.appId;';
echo 'var registerRequests = [{version: req.version, challenge: req.challenge}];';
return;
}
else {
return;
@ -268,11 +268,15 @@ if (isset($_SESSION['mailcow_cc_role']) || isset($_SESSION['pending_mailcow_cc_u
echo 'var appId = "' . $appId . '";';
echo 'var challenge = ' . json_encode($challenge) . ';';
echo 'var registeredKeys = ' . json_encode($registeredKey) . ';';
return;
}
else {
return;
}
break;
}
if (!isset($_SESSION['pending_mailcow_cc_username'])) {
switch ($category) {
case "rspamd":
switch ($object) {
case "actions":