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.

Redirecting user based on its permission.

See original GitHub issue

Is there a way to redirect the user to specific path based on its permission? For example, user accessing homepage ’ / ', if he has an admin permission, redirect him to one specific page, if he has a different permission, redirect him to another page.

My first approach was trying a variable or condition in the config.ts file. Although, it doesn’t seem the best way to do it.

routes: [
  {
     path: '/',
     redirect: REDIRECT USER TO A PATH BASED ON ITS AUTHORITY FLAG,
     authority: ['admin', 'guest'],
   },
];

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

0reactions
renatognunescommented, May 25, 2020

@chenshuai2144 could you provide any example of how I redirect the user based on its permission?

E.g. When an user with “Admin” permissions try to access “homepage.com”, I want to redirect him to “homepage.com/admin”. When a guest tries to access “homepage.com”, I want to redirect him to “homepage.com/guest”.

The user permission tag is being saved in local storage when first logged in.

Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Redirect Users from Within Rules
Learn how to customize authentication flows by redirecting users using rules. Example areas that can be customized include MFA, privacy policy acceptance, ...
Read more >
Django redirect user to app based on permission and group
This is what I did: I've created an index view in order to get the user group and redirect to the respective view...
Read more >
Redirect users based on permissions - MSDN - Microsoft
I am looking for my users to login to sharepoint via Form Based Authentication. From the home page I would like a redirect...
Read more >
Spring Security Redirect Users After Login Based on Roles
For example, when an Admin user logs in, he will see the Admin dashboard page. Likewise, a user with role Editor will see...
Read more >
Creating User-Specific Redirects After Login
The most common redirect is based on user type. For example, if the user is an administrator the user is directed to the...
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