corona-react-free-admin-template | Corona React - Free Admin Template | Dashboard library
kandi X-RAY | corona-react-free-admin-template Summary
kandi X-RAY | corona-react-free-admin-template Summary
Love dark mode? Here’s Corona React, now available as a free template. Don’t let the name scare you, Corona is a sleek and sexy admin dashboard from BootstrapDash that is super easy to customize and set up. The free version has enough features for you to kickstart your project. If you like what you see, then check out the full version of this React admin template too.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Registers a new SWF service and registers it in the browser .
- Registers the service worker
- Checks to see if a service worker is reloaded
- Unregister the service worker
- Animates anchor to the page .
- queries an Array
- coded radio code .
- Return a string representation of JN .
- Get the hr .
- Combines a keydown event .
corona-react-free-admin-template Key Features
corona-react-free-admin-template Examples and Code Snippets
Community Discussions
Trending Discussions on corona-react-free-admin-template
QUESTION
When a user is authenticated, I can refresh the page and access all the routes through the website or by entering/refreshing the URL. However, when the user is unauthenticated, although the routing through the website works well, refreshing the URL even on plain route pages (non-private) redirects me to index (main page).
I have used this as the template of my react app and this for adding authentication to my react app. I have tried these two guides seperately and both work well but somehow in my react app their combination leads to the issue I described above.
Below is the code for my app routes:
...ANSWER
Answered 2021-Mar-26 at 21:16It's something to do with the order of execution. The redux state gets erased when you refresh so you need the store.dispatch(setCurrentUser(decoded))
to get called before the PrivateRoute
tries to render. It's not obvious to me precisely where it's going wrong because the if (localStorage.jwtToken) {
block is not async
, though the dispatch
might be?
I would recommend setting the initialState
in authReducer
to isAuthenticated: null
and update to either true
or false
once you've examined the token. Right now your PrivateRoute
only knows two states: authenticated and unauthenticated. We need it to understand a third which is "I don't know yet". In your PrivateRoute
you would render nothing or a loading spinner while isAutheticated
is null
. Don't render the Redirect
until you have a definite false
.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install corona-react-free-admin-template
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page