Vis*_*har 20 asp.net asp.net-identity
我在Asp Dot Net Identity API 2.0 API中遇到了一个奇怪的问题.
当用户注册时,我会向用户发送确认电子邮件.如果用户在注册后的15分钟内确认了他/她的帐户,那么"ConfirmEmailAsync"方法似乎正在运行.
但是15分钟后,如果我尝试确认电子邮件地址,我会收到"无效令牌"错误.
有没有办法设置令牌到期时间?
一个非常令人沮丧的问题,它正在变得非常难以排除故障.
有人可以帮忙吗?
rog*_*uce 47
更改Create方法(App_Start\IdentityConfig.cs文件)中的代码.
if (dataProtectionProvider != null)
{
manager.UserTokenProvider =
new DataProtectorTokenProvider<ApplicationUser>
(dataProtectionProvider.Create("ASP.NET Identity"))
{
TokenLifespan = TimeSpan.FromHours(3)
};
}
Run Code Online (Sandbox Code Playgroud)
来源:http://www.asp.net/identity/overview/features-api/account-confirmation-and-password-recovery-with-aspnet-identity
| 归档时间: |
|
| 查看次数: |
13543 次 |
| 最近记录: |