diff --git a/src/Orchard.Web/Modules/Orchard.OpenId/Controllers/AccountController.cs b/src/Orchard.Web/Modules/Orchard.OpenId/Controllers/AccountController.cs index 01f64c7c61b..bdf7a72bd69 100644 --- a/src/Orchard.Web/Modules/Orchard.OpenId/Controllers/AccountController.cs +++ b/src/Orchard.Web/Modules/Orchard.OpenId/Controllers/AccountController.cs @@ -46,6 +46,7 @@ public AccountController( public ILogger Logger { get; set; } public Localizer T { get; set; } + [AlwaysAccessible] [HttpGet] public ActionResult LogOn() { if (Request.IsAuthenticated) { @@ -68,11 +69,12 @@ public ActionResult LogOn(string userNameOrEmail, string password, string return } var membershipSettings = _membershipService.GetSettings(); + if (user != null && membershipSettings.EnableCustomPasswordPolicy && membershipSettings.EnablePasswordExpiration && _membershipService.PasswordIsExpired(user, membershipSettings.PasswordExpirationTimeInDays)) { - return RedirectToAction("ChangeExpiredPassword", new { username = user.UserName }); + return RedirectToAction("ChangeExpiredPassword", "Account", new { Area = "Orchard.Users", username = user.UserName }); } _authenticationService.SignIn(user, rememberMe); diff --git a/src/Orchard.Web/Modules/Orchard.OpenId/Routes/OpenId.cs b/src/Orchard.Web/Modules/Orchard.OpenId/Routes/OpenId.cs index 4623ef48c46..72668557720 100644 --- a/src/Orchard.Web/Modules/Orchard.OpenId/Routes/OpenId.cs +++ b/src/Orchard.Web/Modules/Orchard.OpenId/Routes/OpenId.cs @@ -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 _openIdProviders; @@ -43,6 +43,57 @@ public IEnumerable GetRoutes() { }, new RouteDescriptor { Priority = 10, + Route = new Route( + "Users/Account/LogOn", + 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 GetRoutes() { }, new MvcRouteHandler()) }, + new RouteDescriptor { Priority = 10, Route = new Route(