0

I used GeneratePasswordResetTokenAsync to generate a password reset token and send it to an email along with the url. But by default now the token will expire in 1 day. My requirement requires the token to expire within 4 days

 using (CurrentTenant.Change(tenantId))
        {
            var emailUser = await UserManager.FindByEmailAsync(email);

            if (emailUser == null)
            {
                throw new UserFriendlyException(_localizer["EmailNotFound"]);
            }

            var identityUser = (await _identityUserRepository.GetQueryableAsync()).Where(e => e.Email == email).FirstOrDefault();
            var token = await UserManager.GeneratePasswordResetTokenAsync(identityUser);
            var encodedToken = HttpUtility.UrlEncode(token);

            await _emailingAppService.SendMailForgotPassword(email, identityUser.Id, identityUser.TenantId, encodedToken);
        }
amer 123
  • 33
  • 3

0 Answers0