I am doing the Advanced Express and Node course, on the part of authenticating with github.
When my database is empty, and I revoked all user tokens in github, when I click login with github it takes me to the page where I authorize, and then it will redirect me instead back to ‘/’ and deserializeUser throws a null error. If I click login with github a second time it properly sends me to /profile.
When i have a clean database, but still have the token in github, when I click login with github, it just redirects me to ‘/’ and deserializeUser() throws a null error, but the account is once again created in the database. I can click login with github a second time to be taken to the profile.
If i revoke the user token in github BUT keep the user in the database, when I click login with github it takes me to github to authorize and then correctly redirects me to /profile.
I am properly perplexed on what is happening.
Here is my github: GitHub - agracy2246/advanced_node_fcc