mirror of
https://github.com/bitwarden/server.git
synced 2025-06-15 07:20:49 -05:00
Change email OTP to 6 digits
This commit is contained in:
parent
7dcd68bb2b
commit
366d1a699f
@ -25,7 +25,7 @@ public class EmailTokenProvider : IUserTwoFactorTokenProvider<User>
|
||||
};
|
||||
}
|
||||
|
||||
public int TokenLength { get; protected set; } = 8;
|
||||
public int TokenLength { get; protected set; } = 6;
|
||||
public bool TokenAlpha { get; protected set; } = false;
|
||||
public bool TokenNumeric { get; protected set; } = true;
|
||||
|
||||
|
@ -7,17 +7,18 @@ using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace Bit.Core.Auth.Identity.TokenProviders;
|
||||
|
||||
/// <summary>
|
||||
/// Generates tokens for email two-factor authentication.
|
||||
/// It inherits from the EmailTokenProvider class, which manages the persistence and validation of tokens,
|
||||
/// and adds additional validation to ensure that 2FA is enabled for the user.
|
||||
/// </summary>
|
||||
public class EmailTwoFactorTokenProvider : EmailTokenProvider
|
||||
{
|
||||
public EmailTwoFactorTokenProvider(
|
||||
[FromKeyedServices("persistent")]
|
||||
IDistributedCache distributedCache) :
|
||||
base(distributedCache)
|
||||
{
|
||||
TokenAlpha = false;
|
||||
TokenNumeric = true;
|
||||
TokenLength = 6;
|
||||
}
|
||||
{ }
|
||||
|
||||
public override Task<bool> CanGenerateTwoFactorTokenAsync(UserManager<User> manager, User user)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user