mirror of
https://github.com/bitwarden/server.git
synced 2025-04-18 19:48:12 -05:00
email 2fa is not case sensitive
This commit is contained in:
parent
6e302e06dc
commit
50a4202739
@ -190,7 +190,7 @@ namespace Bit.Core.Models.Api
|
||||
|
||||
providers.Add(TwoFactorProviderType.Email, new TwoFactorProvider
|
||||
{
|
||||
MetaData = new Dictionary<string, object> { ["Email"] = Email },
|
||||
MetaData = new Dictionary<string, object> { ["Email"] = Email.ToLowerInvariant() },
|
||||
Enabled = true
|
||||
});
|
||||
extistingUser.SetTwoFactorProviders(providers);
|
||||
|
@ -245,9 +245,10 @@ namespace Bit.Core.Services
|
||||
throw new ArgumentNullException("No email.");
|
||||
}
|
||||
|
||||
var email = ((string)provider.MetaData["Email"]).ToLowerInvariant();
|
||||
var token = await base.GenerateUserTokenAsync(user, TokenOptions.DefaultEmailProvider,
|
||||
"2faEmail:" + provider.MetaData["Email"]);
|
||||
await _mailService.SendTwoFactorEmailAsync((string)provider.MetaData["Email"], token);
|
||||
"2faEmail:" + email);
|
||||
await _mailService.SendTwoFactorEmailAsync(email, token);
|
||||
}
|
||||
|
||||
public async Task<bool> VerifyTwoFactorEmailAsync(User user, string token)
|
||||
@ -258,8 +259,9 @@ namespace Bit.Core.Services
|
||||
throw new ArgumentNullException("No email.");
|
||||
}
|
||||
|
||||
var email = ((string)provider.MetaData["Email"]).ToLowerInvariant();
|
||||
return await base.VerifyUserTokenAsync(user, TokenOptions.DefaultEmailProvider,
|
||||
"2faEmail:" + provider.MetaData["Email"], token);
|
||||
"2faEmail:" + email, token);
|
||||
}
|
||||
|
||||
public async Task<U2fRegistration> StartU2fRegistrationAsync(User user)
|
||||
|
Loading…
x
Reference in New Issue
Block a user