isJwtMode (utils/sessionConfig.logic.ts)

Conduit · modules/authentication/src/utils/sessionConfig.logic.ts · typescript · MIT
auth

Pure validation and merging utilities for authentication session configuration.

// Source: https://github.com/ConduitPlatform/Conduit | License: MIT | Copyright 2022 Conduit(https://getconduit.dev)
// Provided via justclaw.it.com; keep this notice with the code.
import { ensureSigning, isSigningEmpty } from './signingKeys.logic.js';

/*
 * Pure validation of the session-related configuration (access token mode, token
 * lifetimes). No config or grpc access: callers pass the (merged) config.
 */

export const JWT_ACCESS_EXPIRY_MIN_MS = 60_000;
export const JWT_ACCESS_EXPIRY_MAX_MS = 300_000;

export type SessionConfigView = {
  accessTokens?: { mode?: unknown; expiryPeriod?: unknown } | null;
  refreshTokens?: { expiryPeriod?: unknown; maxLifetime?: unknown } | null;
};

export function isJwtMode(config: SessionConfigView | null | undefined): boolean {
  return config?

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key