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

Handle missing cookies issue #30

Merged
merged 1 commit into from
Oct 20, 2023

Conversation

JohnScolaro
Copy link
Owner

There is an issue somewhere that results in users requesting data from this website without session cookies. I could reproduce on my phone by logging in, hard-closing the browser, and then re-opening it. On re-open the browser attempts to load the 'logged in' screen with no cookies.

This PR does the following:

1: Delete a whole lot of random stuff from the backend. We don't need any of the html, css, and javascript any more since next.js handles everything now.
2: Wraps all fetch requests so that if a 401 Unauthorized is received, then the user gets re-routed to home.
3: The backend routes now have a decorator to check for the session cookie instead of doing it in each route individually, and instead of manually rerouting to 'index' which doesn't exist, they just return 401 status codes.

There is an issue somewhere that results in users requesting data from
this website without session cookies. I could reproduce on my phone by
logging in, hard-closing the browser, and then re-opening it. On re-open
the browser attempts to load the 'logged in' screen with no cookies.

This PR does the following:

1: Delete a whole lot of random stuff from the backend. We don't need
any of the html, css, and javascript any more since next.js handles
everything now.
2: Wraps all fetch requests so that if a 401 Unauthorized is received,
then the user gets re-routed to home.
3: The backend routes now have a decorator to check for the session
cookie instead of doing it in each route individually, and instead of
manually rerouting to 'index' which doesn't exist, they just return
401 status codes.
@JohnScolaro JohnScolaro self-assigned this Oct 20, 2023
@JohnScolaro JohnScolaro merged commit e27bf7b into main Oct 20, 2023
2 checks passed
@JohnScolaro JohnScolaro deleted the feature/handle-missing-cookies-issue branch October 20, 2023 05:19
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.

1 participant