registerLoginMethod (auth/registry.ts)

Termix · src/backend/auth/registry.ts · typescript · Apache-2.0
auth

Registry for login methods and second factors in Termix, supporting core and plugin extensions.

// Source: https://github.com/Termix-SSH/Termix | License: Apache-2.0 | Copyright 2026 Luke Gustafson
// Provided via justclaw.it.com; keep this notice with the code.
/**
 * Login methods and second factors, from core and from plugins.
 *
 * Password login is registered by core and always present. Everything else
 * (OIDC, LDAP, passkeys, TOTP, ...) registers here from a plugin through
 * ctx.auth.
 */

import type {
  PluginLoginMethod,
  PluginSecondFactor,
} from "@termix-ssh/plugin-sdk/backend";

export type LoginMethod = PluginLoginMethod & { pluginId: string };
export type SecondFactor = PluginSecondFactor & { pluginId: string };

const loginMethods = new Map<string, LoginMethod>();
const secondFactors = new Map<string, SecondFactor>();

function register<T extends { id: string; plug

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

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

Get a free API key