mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-09-11 11:15:58 +03:00
Allows Custom Yubico OTP Server
This commit is contained in:
@@ -561,7 +561,14 @@ fn verify_yubikey_otp(otp: String) -> JsonResult {
|
||||
let yubico = Yubico::new();
|
||||
let config = Config::default().set_client_id(CONFIG.yubico_client_id.to_owned()).set_key(CONFIG.yubico_secret_key.to_owned());
|
||||
|
||||
let result = yubico.verify(otp, config);
|
||||
let result;
|
||||
|
||||
if CONFIG.yubico_server.is_some() {
|
||||
result = yubico.verify(otp, config.set_api_hosts(vec![CONFIG.yubico_server.to_owned().unwrap()]));
|
||||
}
|
||||
else {
|
||||
result = yubico.verify(otp, config);
|
||||
}
|
||||
|
||||
match result {
|
||||
Ok(_answer) => Ok(Json(json!({}))),
|
||||
|
Reference in New Issue
Block a user