-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setUserSession()
is merging data
#42
Comments
I understand your concern @maximilianmikus So far I decided to merge the data as it is very useful for user to connect multiple providers for a specific session (see playground). Maybe we could introduce a |
sounds good! @atinux What do you think about renaming if that is too big of a change. I think its fine to add replaceSession() for now. |
This will be a breaking chance, I rather have Feel free to open a PR for it! |
ok will do! |
The naming of the function
setUserSession
suggest you can set data to what you provide as an argument. In fact new data is always merged with old session data.defu(data, session.data)
merges data deeply. If you want to actually delete data, you cannot do it. In addition to thissession.update
will perform an object.assign call (shallow merge).I think we should have different functions for setting and updating(merging) session data.
The text was updated successfully, but these errors were encountered: