Resolve "Bug - Refreshing on any page sometimes takes you to the login page"#673
Resolve "Bug - Refreshing on any page sometimes takes you to the login page"#673
Conversation
LOT-641 Bug - Refreshing on any page sometimes takes you to the login page
### Summary When refreshing a page on the frontend, sometimes it will take you to the login page, even if you are logged in. ### Steps to reproduce No predictable way of doing this but keep refreshing on pages like customers, settings, metrics etc. ### What is the current *bug* behavior? Should not refresh to login page, therefore it should understand that you are logged in before rendering the page. ### What is the expected *correct* behavior? Refreshing a page while you are loggedin keeps you on the same page ### Relevant console or network errors Screen Shot 2023-03-12 at 8.29.26 PM.png ### Notes I believe what is happening is it is using an incorrect token after refreshing, or it is confirming we are logged in out of order. |
| const isAuthenticated = | ||
| isLoading && !sessionData ? false : sessionData?.isAuthenticated; | ||
|
|
||
| const contextClass = { |
There was a problem hiding this comment.
was this deleted because it wasn't being used anywhere @glamboyosa
There was a problem hiding this comment.
yah. has not been used in a long time.
| }>(["session"], fetchSessionInfo, { refetchInterval: 60000 }); | ||
|
|
||
| const isAuthenticated = isLoading ? false : sessionData?.isAuthenticated; | ||
| const isAuthenticated = |
…n page" (#673) Co-authored-by: mnida <[email protected]> Co-authored-by: mnida <[email protected]>
Closes
Closes LOT-641.
Description
Sometimes when you refresh it kinda logs you out. well more routes you. to login. This PR fixes it.