Asp.NET Identity 2 giving “Invalid Token” error

前端 未结 21 1946
情话喂你
情话喂你 2020-11-27 03:04

I\'m using Asp.Net-Identity-2 and I\'m trying to verify email verification code using the below method. But I am getting an \"Invalid Token\"

21条回答
  •  借酒劲吻你
    2020-11-27 03:54

    Make sure when generate, you use:

    GeneratePasswordResetTokenAsync(user.Id)
    

    And confirm you use:

    ResetPasswordAsync(user.Id, model.Code, model.Password)
    

    If you make sure you are using the matching methods, but it still doesn't work, please verify that user.Id is the same in both methods. (Sometimes your logic may not be correct because you allow using same email for registry, etc.)

提交回复
热议问题