thal9201
TTCTheo's Typesafe Cult
•Created by thal9201 on 7/13/2023 in #questions
Next-Auth Access to custom data in sessions database
Hi All,
I implemented a new column into the "sessions" table called "selectedClientID". Users will have access to multiple clients and I want the session to keep track of what client they have selected.
In my current implementation, I can't seem to retrieve the "selectedClientID" in the sessions table. This is the current code:
In the above, ideally, the variable session would return the selected client and so if the trigger=== "update" and there is a new selectedClientID in "newSession", it would trigger an update and persist it to the database.
I am unsure if I am looking at the problem the right way, so any help would be greatly appreciated.
Many thanks!
21 replies