2 Answer(s)
-
1
hi
You can add the redirect code in the Index page. This is easiest
public ActionResult Index() { if (CurrentUser.IsAuthenticated && CurrentUser.Roles.Contains("ContentManager")) { return Redirect("~/ManagerRequests"); } return Page(); }You can also do it in the
OnSignedInmethod.context.Services.ConfigureApplicationCookie(options => { var previousOnSignedIn = options.Events.OnSignedIn; options.Events.OnSignedIn = async cookieSignedInContext => { await previousOnSignedIn(cookieSignedInContext); var currentUser = cookieSignedInContext.HttpContext.RequestServices.GetRequiredService<ICurrentUser>(); if (currentUser.IsAuthenticated && currentUser.Roles.Contains("ContentManager")) { cookieSignedInContext.HttpContext.Response.Redirect("api/account/authenticator-info"); } }; }); }Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)