class SessionSecretMissingError
extends Error
Since 0.2.0

Thrown during register() when no usable session secret could be resolved, or when the resolved secret is too short.

This is deliberately a startup failure rather than a per-request one: a misconfigured secret makes every session unreadable, and discovering that on the first login is worse than discovering it on boot.

Examples

Example 1

try {
  await app.start({ port: 3000 });
} catch (err) {
  if (err instanceof SessionSecretMissingError) {
    console.error('Set SESSION_SECRET (min 32 chars)');
  }
}

Constructors

SessionSecretMissingError(message: string)
Parameters
message: string

What was missing and how to supply it

Properties

readonly
name: string

Discriminant for consumers that cannot use instanceof across realms.

Usage

import { SessionSecretMissingError } from "session-plugin/src/index.ts";