Spiegel von
https://github.com/dani-garcia/vaultwarden.git
synchronisiert 2024-11-26 05:50:29 +01:00
Disable Yubikey 2FA if 0 Keys Provided
Dieser Commit ist enthalten in:
Ursprung
82e2b8a8c0
Commit
aba9c28226
1 geänderte Dateien mit 7 neuen und 0 gelöschten Zeilen
|
@ -630,6 +630,13 @@ fn activate_yubikey(data: JsonUpcase<EnableYubikeyData>, headers: Headers, conn:
|
||||||
|
|
||||||
let yubikeys = parse_yubikeys(&data);
|
let yubikeys = parse_yubikeys(&data);
|
||||||
|
|
||||||
|
if yubikeys.len() == 0 {
|
||||||
|
return Ok(Json(json!({
|
||||||
|
"Enabled": false,
|
||||||
|
"Object": "twoFactorU2f",
|
||||||
|
})));
|
||||||
|
}
|
||||||
|
|
||||||
// Ensure they are valid OTPs
|
// Ensure they are valid OTPs
|
||||||
for yubikey in &yubikeys {
|
for yubikey in &yubikeys {
|
||||||
if yubikey.len() == 12 {
|
if yubikey.len() == 12 {
|
||||||
|
|
Laden …
In neuem Issue referenzieren