How can I know the user clicked the password link for the first time only in Asp.Net Identity 2 . If user click the link multiple times it should not work.We can set the time for the link but how to set no clicks in the token generated.
Asked
Active
Viewed 490 times
0
-
just define flag and set value is true when user click on first time . – Anant Dabhi Apr 24 '14 at 10:44
-
Thanks for your answer but i am looking that is there any possibility that it can be included in the token generated without checking from Database. – AR M Apr 25 '14 at 09:33
-
How could it be? If I hit back the page isn't going to be reloaded. – Casey Apr 25 '14 at 13:14
1 Answers
2
To store the number of clicks just use a flag in your database described by GujjuDeveloper
If you want to be sure that the link isn't used a second time you can invalidate the token used in the URL by calling
userManager.UpdateSecurityStampAsync()
For more information about revoking a token please read this post: Revoke token generated by UserTokenProvider in ASP.NET Identity 2.0

Community
- 1
- 1

Jimmy van den Berg
- 474
- 1
- 3
- 9
-
Then i think it's better to call `userManager.UpdateSecurityStampAsync()` after user reset the password. – AR M Apr 25 '14 at 09:40
-
I do it just before generation of a new token wich is then send via email to the user. – Jimmy van den Berg May 03 '14 at 07:37