Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refreshing any Page takes the user back to login page and then back to the current page for Logged in users #84

Closed
Joe2k opened this issue Sep 2, 2023 · 3 comments

Comments

@Joe2k
Copy link
Contributor

Joe2k commented Sep 2, 2023

Screen.Recording.2023-09-02.at.10.49.04.AM.mov
@Joe2k
Copy link
Contributor Author

Joe2k commented Sep 2, 2023

@punchagan Im thinking of adding a userFetchedOnce flag also in store and toggle it when the first request to get user succeeds. And only when userFetchedOnce is true and user is not logged in we can navigate them back to Login screen.

What do you think? You have any better ideas?

Another way is totally moving this to use sokid-query and fetching user through that remove user from global store. That will give us fetching, error and data directly

@Joe2k Joe2k changed the title Refreshing Page takes the user back to login page and then back to the current page for Logged in users Refreshing any Page takes the user back to login page and then back to the current page for Logged in users Sep 2, 2023
@punchagan
Copy link
Member

yeah, if you have the patience to do it the right way, I'd prefer doing it using solid-query. Fix it once and for all. :)

@Joe2k
Copy link
Contributor Author

Joe2k commented Sep 4, 2023

Cool will do!

punchagan added a commit that referenced this issue Sep 15, 2023
Extracted duplicated code to fetch user data and initialize flowbite into a
reusable component + a Route wrapper that simplifies and makes it easier to
understand how and where user data is being fetched. This could be a
preparatory commit to switch to solid-query to fetch the user data, along with
the work in 994f1cd.

See #84
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

2 participants