📜  verifyusertokenasync 密码重置令牌 - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:20.599000             🧑  作者: Mango

代码示例1
[HttpGet]
public async Task ResetPassword(string UserId, string token)
{
    ...

    ApplicationUser user = //get user;


    if(!await this._userManager.VerifyUserTokenAsync(user,this._userManager.Options.Tokens.PasswordResetTokenProvider, "ResetPassword", token)){
        ViewBag.Message = this._localizer["tokenNotValid"].Value;
    }

    ...
}