Update new security stamp logic (#1714)
This commit is contained in:
parent
e53e3bc839
commit
e0e69525e2
|
|
@ -2224,11 +2224,7 @@ namespace Microsoft.AspNetCore.Identity
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>The new security secret.</returns>
|
/// <returns>The new security secret.</returns>
|
||||||
public virtual string GenerateNewAuthenticatorKey()
|
public virtual string GenerateNewAuthenticatorKey()
|
||||||
{
|
=> NewSecurityStamp();
|
||||||
byte[] bytes = new byte[20];
|
|
||||||
_rng.GetBytes(bytes);
|
|
||||||
return Base32.ToBase32(bytes);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Generates recovery codes for the user, this invalidates any previous recovery codes for the user.
|
/// Generates recovery codes for the user, this invalidates any previous recovery codes for the user.
|
||||||
|
|
@ -2419,7 +2415,9 @@ namespace Microsoft.AspNetCore.Identity
|
||||||
|
|
||||||
private static string NewSecurityStamp()
|
private static string NewSecurityStamp()
|
||||||
{
|
{
|
||||||
return Guid.NewGuid().ToString();
|
byte[] bytes = new byte[20];
|
||||||
|
_rng.GetBytes(bytes);
|
||||||
|
return Base32.ToBase32(bytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
// IUserLoginStore methods
|
// IUserLoginStore methods
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue