I am using this code to generate password reset links:
private async Task<string> GetNewEmailConfirmationLink(ApplicationUser user)
{
var code = await this.UserManager.GenerateEmailConfirmationTokenAsync(user.Id);
var callbackUrl = Url.Action(
"ConfirmEmail",
"Account",
new { userId = user.Id, code = code },
protocol: Request.Url.Scheme);
return callbackUrl;
}
In principle, this code works just fine - but the link generated is extremely long. While secure, this links needs sometimes to be copy pasted etc. and then it's length tends to cause errors (forgotten elements etc.). Is there any way to shorten this?