diff --git a/apiserver/runtime.txt b/apiserver/runtime.txt index a35d6cba1..fefae710d 100644 --- a/apiserver/runtime.txt +++ b/apiserver/runtime.txt @@ -1 +1 @@ -python-3.11.3 \ No newline at end of file +python-3.11.4 \ No newline at end of file diff --git a/apps/app/components/account/email-code-form.tsx b/apps/app/components/account/email-code-form.tsx index 9132ee994..e1b7aea98 100644 --- a/apps/app/components/account/email-code-form.tsx +++ b/apps/app/components/account/email-code-form.tsx @@ -16,7 +16,7 @@ type EmailCodeFormValues = { token?: string; }; -export const EmailCodeForm = ({ onSuccess }: any) => { +export const EmailCodeForm = ({ handleSignIn }: any) => { const [codeSent, setCodeSent] = useState(false); const [codeResent, setCodeResent] = useState(false); const [isCodeResending, setIsCodeResending] = useState(false); @@ -66,18 +66,23 @@ export const EmailCodeForm = ({ onSuccess }: any) => { const handleSignin = async (formData: EmailCodeFormValues) => { setIsLoading(true); - await authenticationService.magicSignIn(formData).catch((error) => { - setIsLoading(false); - setToastAlert({ - title: "Oops!", - type: "error", - message: error?.response?.data?.error ?? "Enter the correct code to sign in", + await authenticationService + .magicSignIn(formData) + .then((response) => { + handleSignIn(response); + }) + .catch((error) => { + setIsLoading(false); + setToastAlert({ + title: "Oops!", + type: "error", + message: error?.response?.data?.error ?? "Enter the correct code to sign in", + }); + setError("token" as keyof EmailCodeFormValues, { + type: "manual", + message: error?.error, + }); }); - setError("token" as keyof EmailCodeFormValues, { - type: "manual", - message: error.error, - }); - }); }; const emailOld = getValues("email"); diff --git a/apps/app/components/account/github-login-button.tsx b/apps/app/components/account/github-login-button.tsx index 764680d30..d997b3a3d 100644 --- a/apps/app/components/account/github-login-button.tsx +++ b/apps/app/components/account/github-login-button.tsx @@ -19,12 +19,14 @@ export const GithubLoginButton: FC = (props) => { } = useRouter(); // states const [loginCallBackURL, setLoginCallBackURL] = useState(undefined); + const [gitCode, setGitCode] = useState(null); useEffect(() => { - if (code) { + if (code && !gitCode) { + setGitCode(code.toString()); handleSignIn(code.toString()); } - }, [code, handleSignIn]); + }, [code, gitCode, handleSignIn]); useEffect(() => { const origin = @@ -33,12 +35,12 @@ export const GithubLoginButton: FC = (props) => { }, []); return ( -
+
- diff --git a/apps/app/components/account/google-login.tsx b/apps/app/components/account/google-login.tsx index 237439def..c12fb4e24 100644 --- a/apps/app/components/account/google-login.tsx +++ b/apps/app/components/account/google-login.tsx @@ -47,7 +47,11 @@ export const GoogleLoginButton: FC = (props) => { return ( <>