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:
| Parameter | Type | Description |
|---|---|---|
req | MonoCloudRequest | The incoming request initiating authentication. |
Promise<ApplicationState> | ApplicationState
Returns an application state object, either synchronously or as a Promise.