-
Notifications
You must be signed in to change notification settings - Fork 13
Description
Hello Alan,
I found one more thing.
If a new user required the email confirmation and the new user login the system using the email address as username, the user forward to the EmailNotConfirmed page. If the user click "Re-send email" button, it throw the login failed exception like below:
Login failed!
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: Abp.UI.UserFriendlyException: Login failed!
Source Error:
Line 315: {
Line 316: var user = await _userManager.Users.FirstOrDefaultAsync(a => a.UserName == userName);
Line 317: if (user == null) throw CreateExceptionForFailedLoginAttempt(loginResultType, userName, tenancyName);
Line 318: var token = await _userManager.GenerateEmailConfirmationTokenAsync(user.Id);
Line 319: var confirmationUrl = Url.Action("EmailConfirmation", newSource File: C:\Users...\AbpCinotamZero-SPA-only-master\AbpCinotamZero-SPA-only-master\Cinotam.AbpModuleZero.Web\Controllers\AccountController.cs Line: 317
The reason is it searchs the userName to find the user object refer to the blow code. You may need to handle both userName and email address to find the user object or just allow userName only in the login page.
var user = await _userManager.Users.FirstOrDefaultAsync(a => a.UserName == userName);
if (user == null) throw CreateExceptionForFailedLoginAttempt(loginResultType, userName, tenancyName);
Thanks.