HELP : When refresh page its redirect on dashboard
See original GitHub issuei have check permission on route. its working file. thanks for your time.
my issue is i load permission list when application startup.
for ex
my current page http://localhost:4200/#/app/users
. now i refresh page redirect on dashboard instead of stay on current page. but i don’t know how to resolve this issue. i also try to-load-permissions-before-application-start-up
.
please help me. Thanks in advance
component: UsersComponent, children: [ { path: '', component: UsersListComponent, pathMatch: 'full', canActivate: [NgxPermissionsGuard], data: { permissions: { only: 'read_user', redirectTo: ConfigConstant.DEFAULT_ROUTE }, title: 'Users · Life AI' } },
Angular version:4.0.2 ngx-permissions version: ^1.0.0
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
3 Ways to Fix WordPress Login Refreshing & Redirecting
1. Clear Your Browser Cookies and Cache. The quickest way to solve the WordPress login redirect issue is by clearing your browser cookies...
Read more >Redirect to dashboard on refresh if user is logged in React ...
First thing, in your useEffect, you are re-directing to /dashboard . However, in here <Route path="/dashboard" element={<PrivateRoute ...
Read more >How to Fix WordPress Login Page Refreshing ... - WPBeginner
Incorrect WordPress URL settings and failure to set login cookies are the most common reasons causing the login page redirect and refresh issue....
Read more >Redirected temporarily to login page after refresh
The browser redirects to the login page for a few seconds, and then back to the original page. I'm using a ProtectedRoute component...
Read more >Redirect doesn't work – user not logged until page reload
It sounds like an issue with the Cache control headers. Cache control headers are set either by the host or some caching plugin,...
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
@AlexKhymenko thank you for you response. and now i found what the problem is. it’s a bug on angular CanActivate guards on child routes run before parent CanActivate guards finish. it fixed in version 4.3.2
oh, because i set a judgement to decide which flow i will use. Look at this
when refresh page the variable this.appConfig.hasGetAuthInfo is false. so the function _isActivate wouldn’t run. After getting the user info and permissions, it will change to true. and In this moment, function _isActive will run.