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

fix: JWT Backend Storage, JWT Bugs #136

Merged
merged 19 commits into from
Nov 13, 2023
Merged

fix: JWT Backend Storage, JWT Bugs #136

merged 19 commits into from
Nov 13, 2023

Conversation

juslam19
Copy link
Contributor

@juslam19 juslam19 commented Nov 9, 2023

  • Fix logging out requiring a valid access token, can now do so without any token
  • Reset password now will log everything out by purging refresh token
  • Fix token using mutable user data, now only uses immutable data parts
  • Only allow one refreshToken at a time:
  • To ensure only one login on a client (browser)
  • To ensure a clean backend storage, as if user keeps logging in and deleting refreshToken, will accumulate
  • Prevent stealing of old defunct refreshToken, as mentioned earlier
  • Current issues:
  • Still has some issue with middleware: middleware previously used UserWithoutPassword to User unsafe typecast
  • Also has issue with jwt expiring outside of refreshing entire page - probably where all issues came from for jwt expiring {Fixed on assignment-3-jwt branch for assignment submission}
  • Shows editQuestion even though that is admin protected for frontend
  • Merged with master and oauth

To fix in future PR, NOT HERE:

  • Make the JWT extend to all services!

I think this bug was always there, in latest commit here:
mostly works for jwt, bug: need to refresh profile page upon login to then see user details, after that works every time

@juslam19 juslam19 changed the title JWT Proper refresh proper backend JWT Fixes: Backend Storage, Bugs Nov 9, 2023
@juslam19 juslam19 requested review from seelengxd and carriezhengjr and removed request for seelengxd November 9, 2023 17:31
@juslam19 juslam19 marked this pull request as draft November 10, 2023 10:36
@juslam19 juslam19 marked this pull request as ready for review November 12, 2023 11:19
@juslam19 juslam19 changed the title JWT Fixes: Backend Storage, Bugs URGENT JWT Fixes: Backend Storage, Bugs Nov 12, 2023
@juslam19 juslam19 requested a review from seelengxd November 13, 2023 13:07
Copy link
Contributor

@seelengxd seelengxd left a comment

Choose a reason for hiding this comment

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

don't see any errors - looks good - maybe merge and see what happens on deployment

the 10s token thing... isnt permanent right?

@juslam19 juslam19 merged commit a926bdf into master Nov 13, 2023
2 checks passed
@juslam19
Copy link
Contributor Author

don't see any errors - looks good - maybe merge and see what happens on deployment

the 10s token thing... isnt permanent right?

regarding the 10s token thing, it is not permanent. It is just to see that the thing overall works for the ones covered by JWT. But let's be real, the presentation and stuff is too easy to mess up. Just to play it superrrr safe, I'll place it at 1h expiry time.

@juslam19 juslam19 changed the title URGENT JWT Fixes: Backend Storage, Bugs Fix: JWT Backend Storage, JWT Bugs Nov 15, 2023
@juslam19 juslam19 changed the title Fix: JWT Backend Storage, JWT Bugs fix: JWT Backend Storage, JWT Bugs Nov 15, 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