rit-sse / WebsiteTheSSEquel

The new SSE website.
MIT License
6 stars 3 forks source link

Bug: Oauth sessions need to be cleared #159

Closed PokeJofeJr4th closed 1 month ago

PokeJofeJr4th commented 2 months ago

Many of us are having issues with OAuth. The login screen returns various errors.

These errors can temporarily be fixed by removing your row in the user and session tables and deleting your cookies in the browser.

We believe this is due to next auth failing to renew old sessions or the seed data that's not connected to actual users. With our current setup, we need this data to run postman tests. We should try to find a way to test the auth without using this seed data.

PokeJofeJr4th commented 2 months ago

image_720

rtyocum commented 2 months ago

User facing error: image

Issue Caused by Next-Auth version bump. Older versions used this in the Account database image

Next-Auth does not allow 2 providers of the same email address. Next-Auth updated provider from google.com to google. The image above breaks oAuth.

image This is the current version of the Google Auth in next-auth: https://github.com/nextauthjs/next-auth/blob/e67a1eb961f232eb55a8ef7cf6be783b97bd4187/packages/next-auth/src/providers/google.ts

To fix, delete all entries in the Account database table, and re-seed the data. npx prisma db seed

package-lock.json was committed to prevent inadvertent version bumps, seed data was also updated to match new version