Skip to content
代码片段 群组 项目
未验证 提交 ff83aea5 编辑于 作者: Hao Kung's avatar Hao Kung 提交者: GitHub
浏览文件

Regenerate the stamp once if there's a token collision in test (#7364)

上级 a677464e
No related branches found
No related tags found
无相关合并请求
......@@ -1846,6 +1846,11 @@ namespace Microsoft.AspNetCore.Identity.Test
token = await manager.GenerateTwoFactorTokenAsync(user, factorId);
Assert.NotNull(token);
IdentityResultAssert.IsSuccess(await manager.UpdateSecurityStampAsync(user));
var token2 = await manager.GenerateTwoFactorTokenAsync(user, factorId);
if (token == token2) // Guard against the rare case there's a totp collision once
{
IdentityResultAssert.IsSuccess(await manager.UpdateSecurityStampAsync(user));
}
Assert.False(await manager.VerifyTwoFactorTokenAsync(user, factorId, token));
IdentityResultAssert.VerifyLogMessage(manager.Logger, $"VerifyTwoFactorTokenAsync() failed for user {await manager.GetUserIdAsync(user)}.");
}
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册