Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

fix(ui): disable sign-in and sso buttons while email/pw are empty (#3670)

Marc Klingen674bdbd9768d
diff --git a/web/src/pages/auth/sign-in.tsx b/web/src/pages/auth/sign-in.tsx
index 483c61d399..075dc7b92e 100644
--- a/web/src/pages/auth/sign-in.tsx
+++ b/web/src/pages/auth/sign-in.tsx
@@ -440,8 +440,10 @@ export default function SignIn({ authProviders, signUpDisabled }: PageProps) {
className="w-full"
loading={credentialsForm.formState.isSubmitting}
disabled={
- env.NEXT_PUBLIC_TURNSTILE_SITE_KEY !== undefined &&
- turnstileToken === undefined
+ (env.NEXT_PUBLIC_TURNSTILE_SITE_KEY !== undefined &&
+ turnstileToken === undefined) ||
+ credentialsForm.watch("email") === "" ||
+ credentialsForm.watch("password") === ""
}
onClick={credentialsForm.handleSubmit(onCredentialsSubmit)}
data-testid="submit-email-password-sign-in-form"
@@ -455,8 +457,9 @@ export default function SignIn({ authProviders, signUpDisabled }: PageProps) {
variant="secondary"
loading={ssoLoading}
disabled={
- env.NEXT_PUBLIC_TURNSTILE_SITE_KEY !== undefined &&
- turnstileToken === undefined
+ (env.NEXT_PUBLIC_TURNSTILE_SITE_KEY !== undefined &&
+ turnstileToken === undefined) ||
+ credentialsForm.watch("email") === ""
}
onClick={handleSsoSignIn}
>