Interface: EventCallbacks
index.EventCallbacks
The various event callbacks you can register for from next-auth
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β
Name | Type |
---|---|
message | Object |
message.session | Session |
message.token | JWT |
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β
Name | Type |
---|---|
message | Object |
message.account | null | Account |
message.user | User |
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β
Name | Type |
---|---|
message | Object |
message.session | Session |
message.token | JWT |
Returnsβ
Awaitable
<void
>