I have scaffolded account manage pages at blazor server app. Unfortunately, when I try to change the user email (Identity/Account/Manage/Email), link that is generated seems to be not correct.
var userId = await _userManager.GetUserIdAsync(user);
var code = await _userManager.GenerateChangeEmailTokenAsync(user, Input.NewEmail);
var callbackUrl = Url.Page(
"/Account/ConfirmEmailChange",
pageHandler: null,
values: new { userId = userId, email = Input.NewEmail, code = code },
protocol: Request.Scheme);
await _emailSender.SendEmailAsync(
Input.NewEmail,
"Confirm your email",
$"Please confirm your account by <a href='{HtmlEncoder.Default.Encode(callbackUrl)}'>clicking here</a>.");
When I use that link invalid token error is generated. The worse is that I have no idea how I can investigate that problem. All other links (password reset, confirmation email after registration) works correctly. Maybe that is connected with fact that the user class is extended by a few additional fields. Still, I don't have an idea about the next steps.
public class AspNetUser : IdentityUser
{
[StringLength(100)]
public string FirstName { get; set; }
[StringLength(100)]
public string LastName { get; set; }
//ect..
}