You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How do I Modify the User model when using MongoDB?
Would the modified properties be included in the session.user object?
If so, could you manually in-/exclude properties that should/shouldn't be included?
What are you trying to do
I want to add a custom property to the existing User model and add it to the session data. I tried following these steps but I couldn't get the model to be modified. Is there some easy way to modify the MongoDB models that I'm missing?
Also, the documentation states that the User object is passed as a session argument. But what if I'd save additional, sensitive user information that shouldn't be included in the session data?
This discussion was converted from issue #561 on December 07, 2020 17:05.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Your question
What are you trying to do
I want to add a custom property to the existing User model and add it to the session data. I tried following these steps but I couldn't get the model to be modified. Is there some easy way to modify the MongoDB models that I'm missing?
Also, the documentation states that the User object is passed as a session argument. But what if I'd save additional, sensitive user information that shouldn't be included in the session data?
Beta Was this translation helpful? Give feedback.
All reactions