feat: add FORM_LOGIN_ENABLED auth toggle (#334)

This commit is contained in:
Daniel Volz
2026-02-27 00:48:58 +01:00
committed by GitHub
parent 8b3901c1e1
commit 19ba4bb7d2
7 changed files with 61 additions and 32 deletions
+6 -6
View File
@@ -20,7 +20,7 @@ export interface User {
export interface AuthState {
authEnabled: boolean;
registrationEnabled: boolean;
localAuthEnabled: boolean;
formLoginEnabled: boolean;
oidcEnabled: boolean;
oidcProviderName: string;
hasUsers: boolean;
@@ -425,7 +425,7 @@ export function LoginForm({
</svg>
{t("auth.loginWithSSO", "Login with {{provider}}", { provider: authState.oidcProviderName || "SSO" })}
</button>
{authState?.localAuthEnabled && (
{authState?.formLoginEnabled && (
<div className="auth-divider">
<span>{t("auth.or", "or")}</span>
</div>
@@ -434,7 +434,7 @@ export function LoginForm({
)}
{/* Local Login Form - only show if local auth is enabled */}
{authState?.localAuthEnabled && (
{authState?.formLoginEnabled && (
<form onSubmit={handleSubmit} className="auth-form">
{error && <div className="auth-error">{error}</div>}
@@ -474,7 +474,7 @@ export function LoginForm({
</form>
)}
{authState?.registrationEnabled && authState?.localAuthEnabled && onSwitchToRegister && (
{authState?.registrationEnabled && authState?.formLoginEnabled && onSwitchToRegister && (
<div className="auth-links">
<button type="button" className="auth-link-btn" onClick={onSwitchToRegister}>
{t("auth.createAccount", "Create account")}
@@ -540,7 +540,7 @@ export function RegisterForm({ onSuccess, onSwitchToLogin }: { onSuccess?: () =>
</svg>
{t("auth.loginWithSSO", "Login with {{provider}}", { provider: authState.oidcProviderName || "SSO" })}
</button>
{authState?.localAuthEnabled && (
{authState?.formLoginEnabled && (
<div className="auth-divider">
<span>{t("auth.or", "or")}</span>
</div>
@@ -549,7 +549,7 @@ export function RegisterForm({ onSuccess, onSwitchToLogin }: { onSuccess?: () =>
)}
{/* Local Registration Form - only show if local auth is enabled */}
{authState?.localAuthEnabled && (
{authState?.formLoginEnabled && (
<form onSubmit={handleSubmit} className="auth-form">
{error && <div className="auth-error">{error}</div>}