question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Redirect after successful manager login

See original GitHub issue

Is 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:closed
  • Created 4 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
tidyuicommented, Feb 3, 2020

@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.

1reaction
tidyuicommented, Jan 31, 2020

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found