Use the local scripts instead of cloudflare, remove jquery and update config so disabling a master toggle doesn't remove the values

This commit is contained in:
Daniel García
2019-08-31 17:47:52 +02:00
parent bfc517ee80
commit e3404dd322
11 changed files with 12790 additions and 124 deletions

View File

@ -31,13 +31,13 @@ struct DuoData {
impl DuoData {
fn global() -> Option<Self> {
match CONFIG.duo_host() {
Some(host) => Some(Self {
match (CONFIG._enable_duo(), CONFIG.duo_host()) {
(true, Some(host)) => Some(Self {
host,
ik: CONFIG.duo_ikey().unwrap(),
sk: CONFIG.duo_skey().unwrap(),
}),
None => None,
_ => None,
}
}
fn msg(s: &str) -> Self {

View File

@ -59,6 +59,10 @@ fn jsonify_yubikeys(yubikeys: Vec<String>) -> serde_json::Value {
}
fn get_yubico_credentials() -> Result<(String, String), Error> {
if !CONFIG._enable_yubico() {
err!("Yubico support is disabled");
}
match (CONFIG.yubico_client_id(), CONFIG.yubico_secret_key()) {
(Some(id), Some(secret)) => Ok((id, secret)),
_ => err!("`YUBICO_CLIENT_ID` or `YUBICO_SECRET_KEY` environment variable is not set. Yubikey OTP Disabled"),