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
This would enable us to utilize parameter destructuring when passing data to the session in the session callback, which would make the code cleaner and less verbose.
Background
In the version 0.17 of @auth/core, as far as I have observed, the session callback expected the following parameters:
If the intention is to convey that the keys user and token will never be returned simultaneously, consider changing the type definition to the following:
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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
This would enable us to utilize parameter destructuring when passing data to the session in the session callback, which would make the code cleaner and less verbose.
Background
In the version 0.17 of @auth/core, as far as I have observed, the session callback expected the following parameters:
However, in version 0.20, the session callback now expects the following structure:
The issue with this change is that it requires more verbose code to manipulate the parameter values, as illustrated below :
In contrast, in previous versions, parameter destructuring could be used more succinctly:
Proposal
If the intention is to convey that the keys user and token will never be returned simultaneously, consider changing the type definition to the following:
This modification allows for continued use of parameter destructuring.
Beta Was this translation helpful? Give feedback.
All reactions