mirror of
https://github.com/jakejarvis/sofa.git
synced 2026-08-29 06:15:39 -04:00
Support self-hosted OIDC providers (Authentik, Authelia, Keycloak, etc.) configured entirely via environment variables. Uses Better Auth's hooks.before to gate email/password sign-up at the endpoint level, and disables emailAndPassword entirely when DISABLE_PASSWORD_LOGIN is set. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
11 lines
315 B
TypeScript
11 lines
315 B
TypeScript
"use client";
|
|
|
|
import { adminClient, genericOAuthClient } from "better-auth/client/plugins";
|
|
import { createAuthClient } from "better-auth/react";
|
|
|
|
export const authClient = createAuthClient({
|
|
plugins: [adminClient(), genericOAuthClient()],
|
|
});
|
|
|
|
export const { signIn, signUp, signOut, useSession } = authClient;
|