Skip to Content
AuthConstants

Auth constants

Exported from @sumx/ssr-auth-core / @sumx/ssr-auth-core/auth-constants.

Broadcast & storage keys

ConstantValue / purpose
AUTH_LOGOUT_BROADCAST_KEYCross-tab logout (localStorage)
AUTH_LOGIN_BROADCAST_KEYCross-tab login notification
AUTH_FORCE_PROMPT_LOGIN_KEYForce interactive login on next sign-in
LAST_OIDC_PIPELINE_SUB_STORAGE_KEYLast OIDC subject for pipeline compare
LAST_OIDC_PIPELINE_IDENTITY_KEYSerialized pipeline identity
AUTH_EVENT_CHANNEL_NAMEBroadcastChannel for auth events
LEGACY_AUTH_CLEANUP_MARKER_KEYOne-time legacy storage cleanup
AUTH_SESSION_TIMEOUT_DIALOG_KEYCross-tab “session elsewhere” UI flag
RETURN_PATH_STORAGE_KEYStored post-login path

Cookies & endpoints

ConstantPurpose
SUMX_IS_LOGGED_IN_COOKIE_NAMEClient-readable logged-in flag (isLoggedIn)
AUTH_SESSION_SYNC_ENDPOINT/api/auth/session
AUTH_LOGOUT_ENDPOINT/api/auth/logout
AUTH_SESSION_SYNC_HEADERx-auth-session-sync — marks sync requests

Timeouts (ms)

ConstantDefaultUse
INTERACTIVE_SIGNIN_TIMEOUT_MS8000OIDC interactive sign-in
AUTH_SESSION_VERIFY_TIMEOUT_MS25000Server session verification
USER_INITIATED_SERVER_LOGOUT_POST_TIMEOUT_MS3000Logout POST budget

AUTH_STORAGE_SYNC_KEYS

Keys cleared/synced on auth state changes (used by portal cookie utils).

Example

import { AUTH_SESSION_SYNC_ENDPOINT, RETURN_PATH_STORAGE_KEY, } from '@sumx/ssr-auth-core/auth-constants';

Use these instead of hardcoding strings so kit and portal stay aligned across versions.