Sign in

Handler Type: OnSetApplicationState

OnSetApplicationState = (req: MonoCloudRequest) => Promise<ApplicationState> | ApplicationState

Callback invoked when the authentication state is being created before redirecting the user to the authorization server.

Use this hook to attach custom application state that should survive the authentication round-trip and be available after the user returns from sign-in.

The returned value is stored securely and later provided during session creation.

Common use cases include:

  • Preserving return URLs or navigation context
  • Passing tenant or organization identifiers
  • Storing temporary workflow state across authentication

Parameters

ParameterTypeDescription
reqMonoCloudRequestThe incoming request initiating authentication.

Returns

Promise<ApplicationState> | ApplicationState

Returns an application state object, either synchronously or as a Promise.

© 2024 MonoCloud. All rights reserved.