-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
adjust routers in openid module #7528
base: dev
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
using Orchard.Mvc.Routes; | ||
using Orchard.OpenId.Services; | ||
|
||
namespace Orchard.Azure.Authentication { | ||
namespace Orchard.OpenId.Routes { | ||
public class OpenIdRoutes : IRouteProvider { | ||
private readonly IEnumerable<IOpenIdProvider> _openIdProviders; | ||
|
||
|
@@ -43,6 +43,57 @@ public IEnumerable<RouteDescriptor> GetRoutes() { | |
}, | ||
new RouteDescriptor { | ||
Priority = 10, | ||
Route = new Route( | ||
"Users/Account/LogOn", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the goal to replace the one from Users ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need to replace the routes, once the user sets the settings correctly of one of the enabled OpenId features the app will register the routes automatically after the first restart. |
||
new RouteValueDictionary { | ||
{"area", "Orchard.OpenId"}, | ||
{"controller", "Account"}, | ||
{"action","LogOn" } | ||
}, | ||
new RouteValueDictionary(), | ||
new RouteValueDictionary { | ||
{"area", "Orchard.OpenId"}, | ||
{"controller", "Account"}, | ||
{"action","LogOn" } | ||
}, | ||
new MvcRouteHandler()) | ||
}, | ||
new RouteDescriptor { | ||
Priority = 10, | ||
Route = new Route( | ||
"Users/Account/LogOff", | ||
new RouteValueDictionary { | ||
{"area", "Orchard.OpenId"}, | ||
{"controller", "Account"}, | ||
{"action","LogOff" } | ||
}, | ||
new RouteValueDictionary(), | ||
new RouteValueDictionary { | ||
{"area", "Orchard.OpenId"}, | ||
{"controller", "Account"}, | ||
{"action","LogOff" } | ||
}, | ||
new MvcRouteHandler()) | ||
}, | ||
new RouteDescriptor { | ||
Priority = 10, | ||
Route = new Route( | ||
"Users/Account/AccessDenied", | ||
new RouteValueDictionary { | ||
{"area", "Orchard.OpenId"}, | ||
{"controller", "Account"}, | ||
{"action","AccessDenied" } | ||
}, | ||
new RouteValueDictionary(), | ||
new RouteValueDictionary { | ||
{"area", "Orchard.OpenId"}, | ||
{"controller", "Account"}, | ||
{"action","AccessDenied" } | ||
}, | ||
new MvcRouteHandler()) | ||
}, | ||
new RouteDescriptor { | ||
Priority = -20, | ||
Route = new Route( | ||
"Users/Account/{action}", | ||
new RouteValueDictionary { | ||
|
@@ -56,6 +107,7 @@ public IEnumerable<RouteDescriptor> GetRoutes() { | |
}, | ||
new MvcRouteHandler()) | ||
}, | ||
|
||
new RouteDescriptor { | ||
Priority = 10, | ||
Route = new Route( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the same PR you change this to the Users module, but you also create routes for the OpenId module, on the same Controller/Action names, is that on purpose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will redirect action to ChangeExpiredPassword in Orchard.Users because there is no ChangeExpiredPassword in opened module.
The purpose of the routes will redirect other action.(and also consistent to original code)
For this specific ChangeExpiredPassword action, considerate both of the above, it will redirect the ChangeExpiredPassword in Orchard.Users module with my test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But if the user is logged in with one of the OpenId providers, we can't change his/her password, because we don't own it!
So I think we need to implement custom logic to detect whether the user is logged in using a local account and then redirect to the change password action.