chapter
chapter copied to clipboard
Post Auth0 integration changes
As first mentioned in https://github.com/freeCodeCamp/chapter/pull/1293#issuecomment-1205110524 after https://github.com/freeCodeCamp/chapter/pull/1293 goes in, there are a things needing doing. I'll expand on them here:
- [ ] Investigate
express-session
- it might be simpler to use that and https://github.com/kleydon/prisma-session-store than maintain our own code that (at first glance, at least) does the same thing. - [ ] Use passport to set the
req.user
object. This requires a small refactor (since we currently attach both user and events to req, not just user), but should make it far easier to incorporate other strategies post MVP. Also, since passport is a standard library, it should be easier to maintain than my custom implementation. - [x] Replace the janky dev login?
- [x] Related to the dev login, it should be possible to stay logged out. If we keep the current dev login, that can done by deleting the current-user.json file.
- [x] Remove the login and registration pages
The dev login needs to allow developers and Cypress to switch between user accounts for testing purposes. I'm not sure what the best approach is, but one possibility comes to mind:
Create a dev only login page to let devs enter the email they wish to login with. So, instead of redirecting to auth0, the login attempt would redirect there. Then that page would POST the email address to the /login endpoint. Since Cypress runs in the browser, it should be possible to skip the UI and simply POST the desired email address.
This is very interesting. I'm down to help you with this feature.
Thanks @hisnameispum that would be great. Let me know if you need more context or clarification.