Hanno Böck commited on 2023-12-08 12:26:18
Zeige 3 geänderte Dateien mit 12 Einfügungen und 6 Löschungen.
... | ... |
@@ -19,7 +19,7 @@ function save_passkey($data, $handle=null) |
19 | 19 |
":credentialPublicKey" => $data->credentialPublicKey, |
20 | 20 |
":rpId" => $data->rpId, |
21 | 21 |
":handle" => $handle, |
22 |
- ":uid" => $_SESSION['userinfo']['uid'] |
|
22 |
+ ":uid" => $_SESSION['userinfo']['uid'], |
|
23 | 23 |
]; |
24 | 24 |
db_query("INSERT INTO system.systemuser_passkey (uid, handle, rpId, credentialId, credentialPublicKey) VALUES " . |
25 | 25 |
"(:uid, :handle, :rpId, :credentialId, :credentialPublicKey)", $args); |
... | ... |
@@ -45,10 +45,11 @@ function list_passkeys() |
45 | 45 |
return $ret; |
46 | 46 |
} |
47 | 47 |
|
48 |
-function delete_systemuser_passkey($id) { |
|
48 |
+function delete_systemuser_passkey($id) |
|
49 |
+{ |
|
49 | 50 |
$args = [ |
50 | 51 |
":id" => $id, |
51 |
- ":uid" => $_SESSION['userinfo']['uid'] |
|
52 |
+ ":uid" => $_SESSION['userinfo']['uid'], |
|
52 | 53 |
]; |
53 | 54 |
db_query("DELETE FROM system.systemuser_passkey WHERE uid=:uid AND id=:id", $args); |
54 | 55 |
} |
... | ... |
@@ -123,8 +123,10 @@ function save_totp_config($description) |
123 | 123 |
|
124 | 124 |
function totp_restoretoken($totp_id) |
125 | 125 |
{ |
126 |
- $result = db_query("SELECT restoretoken FROM system.systemuser_totp WHERE id=:id", |
|
127 |
- [":id" => $totp_id]); |
|
126 |
+ $result = db_query( |
|
127 |
+ "SELECT restoretoken FROM system.systemuser_totp WHERE id=:id", |
|
128 |
+ [":id" => $totp_id] |
|
129 |
+ ); |
|
128 | 130 |
$data = $result->fetch(); |
129 | 131 |
DEBUG("Restoretoken für #{$totp_id} ist {$data['restoretoken']}"); |
130 | 132 |
return $data['restoretoken']; |
... | ... |
@@ -58,7 +58,10 @@ if ($req == 'getCreateArgs') { |
58 | 58 |
base64_decode($_POST["client"]), |
59 | 59 |
base64_decode($_POST["attest"]), |
60 | 60 |
$_SESSION["challenge"], |
61 |
- true, true, false, false |
|
61 |
+ true, |
|
62 |
+ true, |
|
63 |
+ false, |
|
64 |
+ false |
|
62 | 65 |
); |
63 | 66 |
} catch (Exception $ex) { |
64 | 67 |
logger(LOG_ERR, "modules/loginsecurity/passkey_ajax", "loginsecurity", "processCreate failed with {$ex}"); |
65 | 68 |