Skip to Content
AuthSession sync errors

Session sync errors

Typed errors and UI helpers when /api/auth/session fails or blocks the shell.

Module: @sumx/ssr-auth-core/session-sync-errors

Types (auth-session-types)

TypePurpose
ServerSessionStateunknown | present | absent
ServerSessionCheckResultResult of verify call
AuthUiErrorStateTitle + message for error shell
CrossTabSessionDialogStateAnother tab signed in
AuthSessionSyncErrorError with code, status, fatal flags
SyncServerAuthSessionOptionsClient sync options
VerifyServerSessionOptionsVerify options

Factory & parsers

FunctionDescription
createAuthSessionSyncError(code, opts?)Build typed sync error
getAuthSessionErrorStatus(error)HTTP status if present
getAuthSessionErrorMessage(error, fallback?)Safe user message
isFatalAuthSessionError(error)Should not retry silently
isBlockingAuthUiError(error)Blocks main UI (show shell)
createAuthUiErrorState({ error, ... })Map to AuthUiErrorState

Usage in CheckToken

@sumx/ssr-auth-react uses these to decide:

  • Show retry vs sign in again
  • Open Dialog for cross-tab session
  • Clear cookies via portal cookieUtils

Example

import { isBlockingAuthUiError, createAuthUiErrorState, } from '@sumx/ssr-auth-core/session-sync-errors'; if (isBlockingAuthUiError(err)) { setUiError(createAuthUiErrorState({ error: err })); }

Do not log raw tokens when handling errors.