mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2024-11-11 13:32:38 +01:00
Ensures Yubico Creds are set when opening Yubikey Modal
This commit is contained in:
parent
2433d39df5
commit
6d735806c0
@ -578,6 +578,11 @@ fn verify_yubikey_otp(otp: String) -> JsonResult {
|
|||||||
|
|
||||||
#[post("/two-factor/get-yubikey", data = "<data>")]
|
#[post("/two-factor/get-yubikey", data = "<data>")]
|
||||||
fn generate_yubikey(data: JsonUpcase<PasswordData>, headers: Headers, conn: DbConn) -> JsonResult {
|
fn generate_yubikey(data: JsonUpcase<PasswordData>, headers: Headers, conn: DbConn) -> JsonResult {
|
||||||
|
if !CONFIG.yubico_cred_set {
|
||||||
|
err!("`YUBICO_CLIENT_ID` or `YUBICO_SECRET_KEY` environment variable is not set. \
|
||||||
|
Yubikey OTP Disabled")
|
||||||
|
}
|
||||||
|
|
||||||
let data: PasswordData = data.into_inner().data;
|
let data: PasswordData = data.into_inner().data;
|
||||||
|
|
||||||
if !headers.user.check_valid_password(&data.MasterPasswordHash) {
|
if !headers.user.check_valid_password(&data.MasterPasswordHash) {
|
||||||
|
Loading…
Reference in New Issue
Block a user