Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

"Invalid Email Address" thrown for existing users. #10228


User avatar
0
TimMackey created

ANZ ver 8.1.0 angular/.net core

When I use the "Forgot Password" interface, this code in AccountAppService.cs keeps throwing an "InvalidEmailAddress" exception for email addresses of existing users.

        private async Task<User> GetUserByChecking(string inputEmailAddress)
        {
            var user = await UserManager.FindByEmailAsync(inputEmailAddress);
            if (user == null)
            {
                throw new UserFriendlyException(L("InvalidEmailAddress"));
            }

            return user;
        }

1 Answer(s)
  • User Avatar
    0
    TimMackey created

    This issue has been resolved by using the injected UserManager. i.e.

    var user = await _userManager.FindByEmailAsync(inputEmailAddress);