diff options
Diffstat (limited to 'apps/web')
| -rw-r--r-- | apps/web/components/signin/CredentialsForm.tsx | 17 | ||||
| -rw-r--r-- | apps/web/lib/clientConfig.tsx | 2 |
2 files changed, 17 insertions, 2 deletions
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 && ( + <p className="w-full text-center text-destructive">{signinError}</p> + )} + <p className="text-center"> + Password authentication is currently disabled. + </p> + </> + ); + } + return ( <Form {...form}> <form @@ -234,7 +249,7 @@ export default function CredentialsForm() { </TabsContent> <TabsContent value="signup"> {clientConfig.auth.disableSignups || - clientConfig.auth.disablePasswordSignups ? ( + clientConfig.auth.disablePasswordAuth ? ( <p className="text-center">Signups are currently disabled.</p> ) : ( <SignUp /> diff --git a/apps/web/lib/clientConfig.tsx b/apps/web/lib/clientConfig.tsx index 90e6d35c..c5d206e3 100644 --- a/apps/web/lib/clientConfig.tsx +++ b/apps/web/lib/clientConfig.tsx @@ -6,7 +6,7 @@ export const ClientConfigCtx = createContext<ClientConfig>({ demoMode: undefined, auth: { disableSignups: false, - disablePasswordSignups: false, + disablePasswordAuth: false, }, inference: { inferredTagLang: "english", |
