This commit is contained in:
andy 2025-01-23 11:22:52 +01:00 committed by GitHub
commit 80701867ae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 55 additions and 2 deletions

View File

@ -72,11 +72,12 @@ namespace Orchard.OpenId.Controllers
}
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);

View File

@ -5,7 +5,7 @@ using System.Web.Routing;
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;
@ -37,6 +37,57 @@ namespace Orchard.Azure.Authentication {
},
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 {
@ -50,6 +101,7 @@ namespace Orchard.Azure.Authentication {
},
new MvcRouteHandler())
},
new RouteDescriptor {
Priority = 10,
Route = new Route(