From f580bedb1c5bc973cac95c97195deb5660519699 Mon Sep 17 00:00:00 2001 From: Palash Gupta Date: Thu, 13 Oct 2022 14:20:25 +0530 Subject: [PATCH] 1627 login: onsubmit is added (#1635) * feat: onsubmit is updated * chore: precheckComplete handler is updated --- frontend/src/container/Login/index.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/frontend/src/container/Login/index.tsx b/frontend/src/container/Login/index.tsx index 0fd6673844..61276ea3c3 100644 --- a/frontend/src/container/Login/index.tsx +++ b/frontend/src/container/Login/index.tsx @@ -111,6 +111,8 @@ function Login({ setFunc(value); }; + const { sso, canSelfRegister } = precheckResult; + const onSubmitHandler: React.FormEventHandler = async ( event, ) => { @@ -123,6 +125,11 @@ function Login({ return; } + if (precheckComplete && sso) { + window.location.href = precheckResult.ssoUrl || ''; + return; + } + setIsLoading(true); const response = await loginApi({ @@ -176,8 +183,6 @@ function Login({ ); }; - const { sso, canSelfRegister } = precheckResult; - return (