Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
How can I change the access denied route using UmbracoMemberAuthorize.
Currently it is going to /Account/AccessDenied?redirecturl=
I would like it to go /Clients/Login?redirecturl=
Thanks!
You can implement a custom configure options for the member options
public class ConfigureCustomMemberCookieOptions : IConfigureNamedOptions<CookieAuthenticationOptions> { public void Configure(string name, CookieAuthenticationOptions options) { if (name == IdentityConstants.ApplicationScheme || name == IdentityConstants.ExternalScheme) { Configure(options); } } public void Configure(CookieAuthenticationOptions options) { options.AccessDeniedPath = "/Clients/Login?redirecturl="; } }
And then register it in the container, e.g. like this in startup.cs
public void ConfigureServices(IServiceCollection services) { services.AddUmbraco(_env, _config) .AddBackOffice() .AddWebsite() .AddComposers() .Build(); services.ConfigureOptions<ConfigureCustomMemberCookieOptions>(); }
Brilliant!
Thanks Bjarke!
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
How to change the access denied route?
How can I change the access denied route using UmbracoMemberAuthorize.
Currently it is going to /Account/AccessDenied?redirecturl=
I would like it to go /Clients/Login?redirecturl=
Thanks!
You can implement a custom configure options for the member options
And then register it in the container, e.g. like this in startup.cs
Brilliant!
Thanks Bjarke!
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.