mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-09-10 18:55:57 +03:00
Fix issue when using uppercase chars in emails
In the case when SMTP is disabled and. when inviting new users either via the admin interface or into an organization and using uppercase letters, this would fail for those users to be able to register since the checks which were done are case-sensitive and never matched. This PR fixes that issue by ensuring everything is lowercase. Fixes #1963
This commit is contained in:
@@ -73,9 +73,9 @@ impl User {
|
||||
pub const CLIENT_KDF_TYPE_DEFAULT: i32 = 0; // PBKDF2: 0
|
||||
pub const CLIENT_KDF_ITER_DEFAULT: i32 = 100_000;
|
||||
|
||||
pub fn new(mail: String) -> Self {
|
||||
pub fn new(email: String) -> Self {
|
||||
let now = Utc::now().naive_utc();
|
||||
let email = mail.to_lowercase();
|
||||
let email = email.to_lowercase();
|
||||
|
||||
Self {
|
||||
uuid: crate::util::get_uuid(),
|
||||
@@ -349,7 +349,8 @@ impl User {
|
||||
}
|
||||
|
||||
impl Invitation {
|
||||
pub const fn new(email: String) -> Self {
|
||||
pub fn new(email: String) -> Self {
|
||||
let email = email.to_lowercase();
|
||||
Self {
|
||||
email,
|
||||
}
|
||||
|
Reference in New Issue
Block a user