Sign in

Handler Type: OnSessionCreating

OnSessionCreating = (session: MonoCloudSession, idToken?: Partial<IdTokenClaims>, userInfo?: UserinfoResponse, state?: ApplicationState) => Promise<void> | void

Callback invoked when a session is being created or updated.

Use this hook to modify or enrich the session before it is persisted - for example, to attach custom claims, normalize user data, or apply application-specific logic.

Parameters

ParameterTypeDescription
sessionMonoCloudSessionThe session being created or updated. Changes made to this object are persisted.
idToken?Partial<IdTokenClaims>Optional claims extracted from the ID token received during authentication.
userInfo?UserinfoResponseOptional claims returned from the UserInfo endpoint.
state?ApplicationStateOptional application state associated with the authentication request.

Returns

Promise<void> | void

Returns a promise or void. Execution continues once the callback completes.

© 2024 MonoCloud. All rights reserved.