diff --git a/packages/web/app/src/pages/auth-oidc.tsx b/packages/web/app/src/pages/auth-oidc.tsx index eb4ea4219..ea740c13f 100644 --- a/packages/web/app/src/pages/auth-oidc.tsx +++ b/packages/web/app/src/pages/auth-oidc.tsx @@ -14,8 +14,9 @@ function AuthOIDC(props: { oidcId: string; redirectToPath: string }) { if (!env.auth.oidc) { throw new Error('OIDC provider is not configured'); } - await startAuthFlowForOIDCProvider(props.oidcId); + // we need to return something, otherwise react-query will throw an error + return true; }, }); diff --git a/packages/web/app/src/pages/auth-sso.tsx b/packages/web/app/src/pages/auth-sso.tsx index 9bda3c4c2..98a675672 100644 --- a/packages/web/app/src/pages/auth-sso.tsx +++ b/packages/web/app/src/pages/auth-sso.tsx @@ -1,4 +1,4 @@ -import { useCallback } from 'react'; +import { useCallback, useEffect } from 'react'; import { CircleHelpIcon } from 'lucide-react'; import { useForm } from 'react-hook-form'; import { useSessionContext } from 'supertokens-auth-react/recipe/session'; @@ -102,11 +102,14 @@ export function AuthSSOPage(props: { redirectToPath: string }) { }, disabled: sso.isPending, }); + + useEffect(() => { + form.setFocus('slug', { shouldSelect: true }); + }, [sso.isPending]); const { toast } = useToast(); const onSubmit = useCallback( (data: SSOFormValues) => { - sso.reset(); sso.mutate({ slug: data.slug, }); @@ -143,7 +146,7 @@ export function AuthSSOPage(props: { redirectToPath: string }) { ( + render={() => ( Organization slug{' '} @@ -163,7 +166,7 @@ export function AuthSSOPage(props: { redirectToPath: string }) { - +