Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix route ChangePasswordConfirmation #10887

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/OrchardCore.Modules/OrchardCore.Users/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@ public override void Configure(IApplicationBuilder builder, IEndpointRouteBuilde
pattern: userOptions.ChangePasswordUrl,
defaults: new { controller = accountControllerName, action = nameof(AccountController.ChangePassword) }
);

routes.MapAreaControllerRoute(
name: "ChangePasswordConfirmation",
areaName: "OrchardCore.Users",
pattern: userOptions.ChangePasswordConfirmationUrl,
defaults: new { controller = accountControllerName, action = nameof(AccountController.ChangePasswordConfirmation) }
);

routes.MapAreaControllerRoute(
name: "UsersLogOff",
areaName: "OrchardCore.Users",
Expand Down
7 changes: 7 additions & 0 deletions src/OrchardCore/OrchardCore.Users.Abstractions/UserOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ public class UserOptions
private string _loginPath = "Login";
private string _logoffPath = "Users/LogOff";
private string _changePasswordUrl = "ChangePassword";
private string _changePasswordConfirmationUrl = "ChangePasswordConfirmation";
private string _externalLoginsUrl = "ExternalLogins";

public string LoginPath
Expand All @@ -25,6 +26,12 @@ public string ChangePasswordUrl
set => _changePasswordUrl = value.Trim(' ', '/');
}

public string ChangePasswordConfirmationUrl
{
get => _changePasswordConfirmationUrl;
set => _changePasswordConfirmationUrl = value.Trim(' ', '/');
}

public string ExternalLoginsUrl
{
get => _externalLoginsUrl;
Expand Down
1 change: 1 addition & 0 deletions src/docs/reference/modules/Users/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ If you want to specify custom paths to access the authentication related urls, y
"LoginPath": "Login",
"LogoffPath": "Users/LogOff",
"ChangePasswordUrl": "ChangePassword",
"ChangePasswordConfirmationUrl": "ChangePasswordConfirmation",
"ExternalLoginsUrl": "ExternalLogins"
}
}
Expand Down