Add onAuthenticated/onSignIn/`onCreate'
#48
ScottAgirs
started this conversation in
Feature Requests/Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Thinking about enabling multiple sessions for a user, one idea I had was to as an interim enabler of this functionality we could provide hooks that would allow adding logic at the time of creation NextAuth session by introducing
onAuthenticated,onSignIn, and `onCreate' hooks.This would then allow users to create their own local list type, for example,
UserSessionthat would allow a super flexible and open-minded approach to managing sessions depending on their business logic and needs.These hooks would also allow for any other arbitrary logic they may want to incorporate.
Alternative - perhaps a better way?
Another option that possibly is simpler and would leverage the existing
resolveris to simply pass KeystoneAPIqueryanddbobjects to resolver so users could make changes to DB as needed.The downside of this approach would be that it would be a less granular control over the flow and would happen regardless of whether it is the creation of a User (
authenticatedItem) or a login of it.Beta Was this translation helpful? Give feedback.
All reactions