Skip to content

SendConfirmationMail()  #92

@nccheckcashing

Description

@nccheckcashing

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", new

Source 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions