Skip to content

Commit

Permalink
Fix route ChangePasswordConfirmation (#10887)
Browse files Browse the repository at this point in the history
  • Loading branch information
DotCat1985 authored Jan 19, 2022
1 parent 2f3b865 commit 0792276
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
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

0 comments on commit 0792276

Please sign in to comment.