Skip to main content

Interface: EventCallbacks

types.EventCallbacks

The various event callbacks you can register for from next-auth

Documentation

Properties​

session​

β€’ session: (message: { session: Session ; token: JWT }) => Awaitable<void>

Type declaration​

β–Έ (message): Awaitable<void>

The message object will contain one of these depending on if you use JWT or database persisted sessions:

  • token: The JWT token for this session.
  • session: The session object from your adapter.
Parameters​
NameType
messageObject
message.sessionSession
message.tokenJWT
Returns​

Awaitable<void>


signIn​

β€’ signIn: (message: { account: null | Account ; user: User ; isNewUser?: boolean ; profile?: Profile }) => Awaitable<void>

Type declaration​

β–Έ (message): Awaitable<void>

If using a credentials type auth, the user is the raw response from your credential provider. For other providers, you'll get the User object from your adapter, the account, and an indicator if the user was new to your Adapter.

Parameters​
NameType
messageObject
message.accountnull | Account
message.userUser
message.isNewUser?boolean
message.profile?Profile
Returns​

Awaitable<void>


signOut​

β€’ signOut: (message: { session: Session ; token: JWT }) => Awaitable<void>

Type declaration​

β–Έ (message): Awaitable<void>

The message object will contain one of these depending on if you use JWT or database persisted sessions:

  • token: The JWT token for this session.
  • session: The session object from your adapter that is being ended.
Parameters​
NameType
messageObject
message.sessionSession
message.tokenJWT
Returns​

Awaitable<void>