Next.js Discord

Discord Forum

Next Auth Refetching Session

Unanswered
Sloth bear posted this in #help-forum
Open in Discord
Sloth bearOP
I have a couple next auth providers -- one being a Google Provider, and another being a CredentialsProvider. Within my app, I make a change to roles which are stored in the user's session, but calling update() does not apply those changes because it is being set on the authorize function in the credentials provider.

This has opened my eyes to an issue where Google Auth will not apply those roles my service is dependent on. Also, I want to make sure that when I call update on the session, I can actually update it.

Could you propose changes to my implementation to be able to accomedate. I may be laking some fundemantal knowledge on both the JWT and session callbacks. Any extra info on how that operate would be excellent as well. Here is the pastebin:
https://pastebin.com/VGMBbtwr

0 Replies