在asp.net Core Identity 中更改EmailAsync“无效令牌”

GTo*_*Tom 8 asp.net-core asp.net-core-identity

我在开发应用程序时遇到了这个问题,但没有找到与之相关的任何问题。

我正在使用 asp.net Core 3.1,win 10。

Sur*_*Rao 0

在“ConfirmEmailChange.cshtml.cs”中进行以下更改:

// code = Encoding.UTF8.GetString(WebEncoders.Base64UrlDecode(code)); // DELETE THIS LINE
var result = await _userManager.ChangeEmailAsync(user, email, code);
Run Code Online (Sandbox Code Playgroud)

这解决了问题。