mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-08-29 14:04:49 +00:00
hide passkey if domain is not set
This commit is contained in:
parent
c70275207c
commit
61353e7a91
3 changed files with 12 additions and 0 deletions
|
@ -64,6 +64,7 @@ fn vaultwarden_css() -> Cached<Css<String>> {
|
|||
"sso_enabled": CONFIG.sso_enabled(),
|
||||
"sso_only": CONFIG.sso_enabled() && CONFIG.sso_only(),
|
||||
"yubico_enabled": CONFIG._enable_yubico() && CONFIG.yubico_client_id().is_some() && CONFIG.yubico_secret_key().is_some(),
|
||||
"webauthn_2fa_supported": CONFIG.is_webauthn_2fa_supported(),
|
||||
});
|
||||
|
||||
let scss = match CONFIG.render_template("scss/vaultwarden.scss", &css_options) {
|
||||
|
|
|
@ -1504,6 +1504,10 @@ impl Config {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn is_webauthn_2fa_supported(&self) -> bool {
|
||||
Url::parse(&self.domain()).expect("DOMAIN not a valid URL").domain().is_some()
|
||||
}
|
||||
|
||||
/// Tests whether the admin token is set to a non-empty value.
|
||||
pub fn is_admin_token_set(&self) -> bool {
|
||||
let token = self.admin_token();
|
||||
|
|
|
@ -168,6 +168,13 @@ app-root a[routerlink="/signup"] {
|
|||
}
|
||||
{{/unless}}
|
||||
|
||||
{{#unless webauthn_2fa_supported}}
|
||||
/* Hide `Passkey` 2FA if it is not supported */
|
||||
.providers-2fa-7 {
|
||||
@extend %vw-hide;
|
||||
}
|
||||
{{/unless}}
|
||||
|
||||
{{#unless emergency_access_allowed}}
|
||||
/* Hide Emergency Access if not allowed */
|
||||
bit-nav-item[route="settings/emergency-access"] {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue