From 9f87207d668fbe0a2039c63803128fbe5916f993 Mon Sep 17 00:00:00 2001 From: kamtschatka Date: Sat, 12 Oct 2024 15:27:21 +0200 Subject: feature: Allow to disable default password login after SSO is configured. Fixes #406 (#502) * [Feature Request] Allow to disable default password log in after SSO is configured #406 changed the flag to also disallow logging in via password The extensions will also no longer be allowed to log in via username/password then * [Feature Request] Allow to disable default password log in after SSO is configured #406 added the error message for OAuth --- apps/web/components/signin/CredentialsForm.tsx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'apps/web/components') diff --git a/apps/web/components/signin/CredentialsForm.tsx b/apps/web/components/signin/CredentialsForm.tsx index a35b768f..313dc7c5 100644 --- a/apps/web/components/signin/CredentialsForm.tsx +++ b/apps/web/components/signin/CredentialsForm.tsx @@ -35,6 +35,8 @@ function SignIn() { const [signinError, setSigninError] = useState(""); const router = useRouter(); const searchParams = useSearchParams(); + const clientConfig = useClientConfig(); + const oAuthError = searchParams.get("error"); if (oAuthError && !signinError) { setSigninError(`${OAUTH_FAILED} ${oAuthError}`); @@ -44,6 +46,19 @@ function SignIn() { resolver: zodResolver(signInSchema), }); + if (clientConfig.auth.disablePasswordAuth) { + return ( + <> + {signinError && ( +

{signinError}

+ )} +

+ Password authentication is currently disabled. +

+ + ); + } + return (
{clientConfig.auth.disableSignups || - clientConfig.auth.disablePasswordSignups ? ( + clientConfig.auth.disablePasswordAuth ? (

Signups are currently disabled.

) : ( -- cgit v1.2.3-70-g09d2