Auth flow migration #267
TanishqSingla
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Overview
Migrate from next-auth to custom hooks and logic along with UI tweaks.
New auth flow
Overview
New auth flow will be pretty straightforward, we'll hit the backend auth endpoints and store the JWT in cookie, which will be validated by backend middlewares.
Auth state
To save and update auth state we can leverage global store solutions like redux or zustand. I personally prefer zustand for it's simplicity and easy to use nature.
Things to check (TBD)
UI Tweaks
This will be the best time to also revamp the auth flow UI. I am breaking this down to following points
Dedicated Pages for auth actions
The current approach poses a lot of challenges with navigation and ease of use, this is due to the fact that we have an endpoint but the page only mounts the modal for login.
That modal further contains SPA routing for different steps, this creates a bunch of problems:
Header Tweaks
Currently header looks the same for authenticated and unauthenticated user, this can be changed to provide better CTA buttons for different users.
Resources
All reactions