From 455602c2b223a7051749f42d8adcd8d74ee71cc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20=C5=BBuraw?= <9116238+krzysztofzuraw@users.noreply.github.com> Date: Tue, 6 Jun 2023 09:42:07 +0200 Subject: [PATCH] Fix redirect loop on login with external provider --- src/auth/components/LoginPage/LoginPage.tsx | 6 +++--- src/auth/views/Login.tsx | 8 +++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/auth/components/LoginPage/LoginPage.tsx b/src/auth/components/LoginPage/LoginPage.tsx index 3388f92e6b6..c9d49874cda 100644 --- a/src/auth/components/LoginPage/LoginPage.tsx +++ b/src/auth/components/LoginPage/LoginPage.tsx @@ -29,7 +29,7 @@ export interface LoginCardProps { onSubmit?: (event: LoginFormData) => SubmitPromise; } -const LoginCard: React.FC = props => { +const LoginPage: React.FC = props => { const { errors, disabled, @@ -179,5 +179,5 @@ const LoginCard: React.FC = props => { ); }; -LoginCard.displayName = "LoginCard"; -export default LoginCard; +LoginPage.displayName = "LoginPage"; +export default LoginPage; diff --git a/src/auth/views/Login.tsx b/src/auth/views/Login.tsx index e06b969f1b8..7e733ed65c1 100644 --- a/src/auth/views/Login.tsx +++ b/src/auth/views/Login.tsx @@ -63,15 +63,13 @@ const LoginView: React.FC = ({ params }) => { }; const handleExternalAuthentication = async (code: string, state: string) => { - const result = await loginByExternalPlugin(requestedExternalPluginId, { + await loginByExternalPlugin(requestedExternalPluginId, { code, state, }); setRequestedExternalPluginId(null); - if (result && !result?.errors?.length) { - navigate(fallbackUri); - setFallbackUri(null); - } + navigate(fallbackUri); + setFallbackUri(null); }; useEffect(() => {