Sign in

Handler Type: OnCoreSessionCreating

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

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.

Parameters

ParameterTypeDescription
sessionMonoCloudSessionThe session being created or updated.
idToken?Partial<IdTokenClaims>Optional. Claims extracted from the ID token.
userInfo?UserinfoResponseOptional. Claims returned from the UserInfo endpoint.

Returns

Promise<void> | void

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

© 2024 MonoCloud. All rights reserved.