Redirecting user based on its permission.
See original GitHub issueIs 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:
- Created 3 years ago
- Comments:5
Top 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 >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
You can resolve this in https://github.com/ant-design/ant-design-pro/blob/bb040b1946bff874a539abe02ddff077404454df/src/utils/request.ts#L51
doc in here https://github.com/umijs/umi-request#example-1
@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!