Skip to content

Resolve "Bug - Refreshing on any page sometimes takes you to the login page"#673

Merged
mnida merged 5 commits intomainfrom
LOT-641-random-log-out-bug
Mar 14, 2023
Merged

Resolve "Bug - Refreshing on any page sometimes takes you to the login page"#673
mnida merged 5 commits intomainfrom
LOT-641-random-log-out-bug

Conversation

@glamboyosa
Copy link
Copy Markdown
Contributor

Closes

Closes LOT-641.

Description

Sometimes when you refresh it kinda logs you out. well more routes you. to login. This PR fixes it.

@glamboyosa glamboyosa requested a review from mnida March 13, 2023 13:34
@linear
Copy link
Copy Markdown

linear Bot commented Mar 13, 2023

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.

@glamboyosa glamboyosa temporarily deployed to Development March 13, 2023 13:34 — with GitHub Actions Inactive
@glamboyosa glamboyosa temporarily deployed to Development March 13, 2023 13:34 — with GitHub Actions Inactive
Comment thread frontend/src/App.tsx
const isAuthenticated =
isLoading && !sessionData ? false : sessionData?.isAuthenticated;

const contextClass = {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was this deleted because it wasn't being used anywhere @glamboyosa

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yah. has not been used in a long time.

Comment thread frontend/src/App.tsx
}>(["session"], fetchSessionInfo, { refetchInterval: 60000 });

const isAuthenticated = isLoading ? false : sessionData?.isAuthenticated;
const isAuthenticated =
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch

@mnida mnida temporarily deployed to Development March 14, 2023 09:30 — with GitHub Actions Inactive
@mnida mnida temporarily deployed to Development March 14, 2023 09:30 — with GitHub Actions Inactive
@mnida mnida temporarily deployed to Development March 14, 2023 16:45 — with GitHub Actions Inactive
@mnida mnida temporarily deployed to Development March 14, 2023 16:45 — with GitHub Actions Inactive
@mnida mnida merged commit 2011f86 into main Mar 14, 2023
@mnida mnida deleted the LOT-641-random-log-out-bug branch March 14, 2023 23:55
glamboyosa added a commit that referenced this pull request Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants