Skip to content

passwordMismatch = The confirmed password doesn't match the new password! isn't always the case eg when the current password isn't a match during changePasswordAsync. #14528

@mistyn8

Description

@mistyn8

Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)

11.4.1

Bug summary

using changePasswordAsyc(), if the current password isn't a match then microsoft.Extensions.Identity.Core.UserManager base method returns ErrorDescriber.PasswordMismatch which would give from base the message Incorrect password.

https://github.com/dotnet/aspnetcore/blob/62af2d714f0a72dd82cb57695b6785ebc41bb289/src/Identity/Extensions.Core/src/UserManager.cs#L753C3-L769

It would appear that Umbraco language is translating that into "The confirmed password doesn't match the new password!" which is a misleading message.. as in the case of Change Password, the error is that the Current Password doesn't match

Steps to reproduce

var resetResult = await _memberManager.ChangePasswordAsync(member, model.CurrentPassword!, model.PasswordDetails!.Password!);

if (!resetResult.Succeeded)
{
    var errors = resetResult.Errors.ToErrorMessage();
    AddErrors(resetResult);
    _logger.LogWarning("Could not change member password {ChangePasswordErrors} [{Code}]", errors, "CP01");
    return CurrentUmbracoPage();
}

and observe the errors when the CurrentPassword isn't a match.

image

Expected result / actual result

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions