commit 6d735806c04b7334eddcfdc7935d0b21d799b1d4
parent 2433d39df5aa37c8927b0583ef1dc1c9a2e9c67f
Author: Stepan Fedorko-Bartos <step7750@gmail.com>
Date: Thu, 15 Nov 2018 18:58:44 -0700
Ensures Yubico Creds are set when opening Yubikey Modal
Diffstat:
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/api/core/two_factor.rs b/src/api/core/two_factor.rs
@@ -578,6 +578,11 @@ fn verify_yubikey_otp(otp: String) -> JsonResult {
#[post("/two-factor/get-yubikey", data = "<data>")]
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;
if !headers.user.check_valid_password(&data.MasterPasswordHash) {