I wanted to provide a draft PR on this to make sure everyone is aligned with the path I’m going down here. Comments, feedback, recommendations all greatly appreciated. This is a big change!
but first, here’s a demo showing registration, sign out, and signing back in:
https://github.com/maybe-finance/maybe/assets/1218724/85103c7a-10f2-491d-a1a6-3854f150048c
A lot going on here, here’s a quick breakdown:
- Add NextAuth/AuthJS
- Implement email/password register/auth (figured its easiest for self host, can add more providers later)
- Add routes and services for finding existing user by email, creating user
- Add Register and Sign In pages, took best stab at styling using design library (if you have mocks from back in the day I’m happy to match previous styles)
- The newly added Auth models are all prefixed with “Auth” to prevent collisions with existing User and Account models
- Add authId to User model
- Update _app.tsx logic to check for session and redirect to sign in if user doesn’t have session
TO-DO:
- Update JWT to match fields that were populated by Auth0
Update middleware and JWT checks
Create User and associate with AuthUser
Figure out how to kick off onboarding for new users
- Continue replacing Auth0 functionality with NextAuth
- ??? Probably a lot more that we’ll find as we continue fixing things.
Hopefully this is some decent progress on #16
/claim #16