I'm facing a strange issue in Asp Dot Net Identity API 2.0 API.
When an user signs up, I send a confirmation email to the user. And if the user confirms his / her account within 15 mins of signing up, the "ConfirmEmailAsync" method seems to be working.
But after 15 mins, if I try to confirm the email address, I'm getting a "Invalid Token" error.
Is there a way to set the token expiry time?
A really frustrating issue and it's becoming very hard to troubleshoot.
Can anyone help please?
Change the code in the Create method(App_Start\IdentityConfig.cs file).
if (dataProtectionProvider != null)
{
manager.UserTokenProvider =
new DataProtectorTokenProvider<ApplicationUser>
(dataProtectionProvider.Create("ASP.NET Identity"))
{
TokenLifespan = TimeSpan.FromHours(3)
};
}
source: http://www.asp.net/identity/overview/features-api/account-confirmation-and-password-recovery-with-aspnet-identity
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With