mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-05-30 15:50:17 +03:00
Compare commits
2 Commits
b2cd556f3e
...
0c6817cb4e
| Author | SHA1 | Date | |
|---|---|---|---|
| 0c6817cb4e | |||
| 25a71d913f |
@@ -3207,7 +3207,7 @@ async fn put_reset_password(
|
||||
|
||||
// Sending email before resetting password to ensure working email configuration and the resulting
|
||||
// user notification. Also this might add some protection against security flaws and misuse
|
||||
if let Err(e) = mail::send_admin_reset_password(&user.email, &user.name, &org.name).await {
|
||||
if let Err(e) = mail::send_admin_reset_password(&user.email, user.display_name(), &org.name).await {
|
||||
err!(format!("Error sending user reset password email: {e:#?}"));
|
||||
}
|
||||
|
||||
|
||||
@@ -144,7 +144,7 @@ async fn generate_webauthn_challenge(data: Json<PasswordOrOtpData>, headers: Hea
|
||||
let (mut challenge, state) = WEBAUTHN.start_passkey_registration(
|
||||
Uuid::from_str(&user.uuid).expect("Failed to parse UUID"), // Should never fail
|
||||
&user.email,
|
||||
&user.name,
|
||||
user.display_name(),
|
||||
Some(registrations),
|
||||
)?;
|
||||
|
||||
|
||||
+2
-2
@@ -266,7 +266,7 @@ async fn _sso_login(
|
||||
Some((user, _)) if !user.enabled => {
|
||||
err!(
|
||||
"This user has been disabled",
|
||||
format!("IP: {}. Username: {}.", ip.ip, user.name),
|
||||
format!("IP: {}. Username: {}.", ip.ip, user.display_name()),
|
||||
ErrorEvent {
|
||||
event: EventType::UserFailedLogIn
|
||||
}
|
||||
@@ -521,7 +521,7 @@ async fn authenticated_response(
|
||||
result["TwoFactorToken"] = Value::String(token);
|
||||
}
|
||||
|
||||
info!("User {} logged in successfully. IP: {}", &user.name, ip.ip);
|
||||
info!("User {} logged in successfully. IP: {}", user.display_name(), ip.ip);
|
||||
Ok(Json(result))
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -60,11 +60,12 @@ fn vaultwarden_css() -> Cached<Css<String>> {
|
||||
"mail_2fa_enabled": CONFIG._enable_email_2fa(),
|
||||
"mail_enabled": CONFIG.mail_enabled(),
|
||||
"sends_allowed": CONFIG.sends_allowed(),
|
||||
"password_hints_allowed": CONFIG.password_hints_allowed(),
|
||||
"signup_disabled": CONFIG.is_signup_disabled(),
|
||||
"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(),
|
||||
"yubico_enabled": CONFIG._enable_yubico() && CONFIG.yubico_client_id().is_some() && CONFIG.yubico_secret_key().is_some(),
|
||||
});
|
||||
|
||||
let scss = match CONFIG.render_template("scss/vaultwarden.scss", &css_options) {
|
||||
|
||||
@@ -231,6 +231,15 @@ impl User {
|
||||
pub fn reset_stamp_exception(&mut self) {
|
||||
self.stamp_exception = None;
|
||||
}
|
||||
|
||||
pub fn display_name(&self) -> &str {
|
||||
// default to email if name is empty
|
||||
if !&self.name.is_empty() {
|
||||
&self.name
|
||||
} else {
|
||||
&self.email
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Database methods
|
||||
|
||||
@@ -192,6 +192,19 @@ bit-nav-item[route="sends"] {
|
||||
@extend %vw-hide;
|
||||
}
|
||||
{{/unless}}
|
||||
|
||||
{{#unless password_hints_allowed}}
|
||||
/* Hide password hints if not allowed */
|
||||
a[routerlink="/hint"],
|
||||
{{#if (webver "<2025.12.2")}}
|
||||
app-change-password > form > .form-group:nth-child(5),
|
||||
auth-input-password > form > bit-form-field:nth-child(4) {
|
||||
{{else}}
|
||||
.vw-password-hint {
|
||||
{{/if}}
|
||||
@extend %vw-hide;
|
||||
}
|
||||
{{/unless}}
|
||||
/**** End Dynamic Vaultwarden Changes ****/
|
||||
/**** Include a special user stylesheet for custom changes ****/
|
||||
{{#if load_user_scss}}
|
||||
|
||||
Reference in New Issue
Block a user