Update new security stamp logic (#1714)

This commit is contained in:
Hao Kung 2018-03-28 11:55:09 -07:00 committed by GitHub
parent e53e3bc839
commit e0e69525e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 6 deletions

View File

@ -2224,11 +2224,7 @@ namespace Microsoft.AspNetCore.Identity
/// </summary>
/// <returns>The new security secret.</returns>
public virtual string GenerateNewAuthenticatorKey()
{
byte[] bytes = new byte[20];
_rng.GetBytes(bytes);
return Base32.ToBase32(bytes);
}
=> NewSecurityStamp();
/// <summary>
/// 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()
{
return Guid.NewGuid().ToString();
byte[] bytes = new byte[20];
_rng.GetBytes(bytes);
return Base32.ToBase32(bytes);
}
// IUserLoginStore methods