Redirect after successful manager login
See original GitHub issueIs it possible to change the deafult redirect without changing the source code of the page? If not, what is the best practice? Maybe I need to create a new login page in my custom module and set up page redirection?
PS: I have user roles for which the ability to view site pages should be closed.
Default Login page redirect (RedirectToPageResult(“PageList”)):
public async Task<IActionResult> OnPostAsync(InputModel model)
{
if (!ModelState.IsValid)
{
return Page();
}
if (await _service.SignIn(HttpContext, model.Username, model.Password))
{
return new RedirectToPageResult("PageList");
}
return Page();
}
Regards.
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
How do you redirect users after a successful login?
To redirect users after a successful login with the login module, choose a menu item under the Options tab, Basic Options section.
Read more >How to Redirect Users After Successful Login in WordPress
The method lets you redirect users after they sign in based on user roles, capabilities, usernames, and more. The easiest way to do...
Read more >redirect to previous page after successful admin login
In your settings.py , make sure you specify where to navigate to after successful login, for example: LOGIN_REDIRECT_URL = '/authorized/'.
Read more >Where to redirect after successful login?
It depends on what the typical user has come to your site/app for. Redirecting to the homepage may not be the best option...
Read more >How to Redirect Users in WordPress After a Successful Login
Let's start by clicking on Plugins and selecting the Add New option on the left-hand admin panel. Search for Peter's Login Redirect in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@chybyk Are we still talking about the manager? If so, yes just insert a page at the start of the menu. Atm all page needs to be contained within a group, but we could change that for the upcoming version.
The code will redirect the user to the first page in the menu he/she has access to. If the user doesn’t have access to anything in the manager he/she will be logged out.
Regards