The session being created or updated.
OptionalidToken: Partial<IdTokenClaims>Optional. Claims extracted from the ID token.
OptionaluserInfo: UserinfoResponseOptional. Claims returned from the UserInfo endpoint.
Returns a promise or void. Execution continues once the callback completes.
Callback invoked before a session is created or updated.
This hook allows you to inspect or modify the session during the authentication lifecycle — for example, to enrich the session with custom claims, normalize user data, or apply application-specific logic.