Closed Eckhardt-D closed 1 year ago
@w3cj I made this a draft PR as I'm not entirely sure if the session fix is an actual fix. The assumption is that Authjs is returning the same user that is being passed to createUser
when calling session(). After inspecting docker logs though it seems that it could also be an issue that occurred in the migrate:
listd-db-1 | 2023-04-29 05:05:28.394 UTC [81] ERROR: insert or update on table "UserSettings" violates foreign key constraint "UserSettings_localeId_fkey"
I think the safest would be to wrap the userSettings
create call in a trycatch since there could be database errors and this is required info on the session, breaking the app for the user until a manual create
is run again. If the create throws, you could revert the user insert? Or stop the account creation in linkAccount
event. 🤔
What type of Pull Request is this?
Documentation updates to install playwright exe's for first timers and not overwrite .env.example.
What is the current behavior?
After setup and launching and signing up for the first time with my Google account, the
settings
were missing from the user object from thecreateUser
event. I could replicate a few times, but required aDROP DATABASE
. I could fix it by explicitly adding the created settings to the session user (perhaps there is a race condition?).Another thought that might require an issue: what if the Prisma insert fails for the User settings?
Issue Number: N/A
What is the new behavior?
Other information
☀️