From c9fcdddaec38766e8fbf6aea855d029af6e98f2e Mon Sep 17 00:00:00 2001 From: Limezy Date: Wed, 14 Feb 2024 16:52:45 +0700 Subject: [PATCH] Remove auto-redirect --- sources/patches/diff.txt | 19 ++++++++++++++++--- sources/patches/main-03-login.patch | 19 ++++++++++++++++--- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/sources/patches/diff.txt b/sources/patches/diff.txt index a210fee..294c600 100644 --- a/sources/patches/diff.txt +++ b/sources/patches/diff.txt @@ -107,10 +107,23 @@ index 5d564453d..9e3c5b55b 100644 })} diff --git a/app/scenes/Login/index.tsx b/app/scenes/Login/index.tsx -index 9a9650b48..5357d5cf5 100644 +index 9a9650b48..e642869b1 100644 --- a/app/scenes/Login/index.tsx +++ b/app/scenes/Login/index.tsx -@@ -264,7 +264,7 @@ function Login({ children }: Props) { +@@ -228,12 +228,6 @@ function Login({ children }: Props) { + ); + } + +- // If there is only one provider and it's OIDC, redirect immediately. +- if (config.providers.length === 1 && config.providers[0].id === "oidc") { +- window.location.href = getRedirectUrl(config.providers[0].authUrl); +- return null; +- } +- + return ( + + +@@ -264,7 +258,7 @@ function Login({ children }: Props) { ) : ( <> @@ -119,7 +132,7 @@ index 9a9650b48..5357d5cf5 100644 authProviderName: config.name || env.APP_NAME, })} -@@ -282,7 +282,7 @@ function Login({ children }: Props) { +@@ -282,7 +276,7 @@ function Login({ children }: Props) { {hasMultipleProviders && ( <> diff --git a/sources/patches/main-03-login.patch b/sources/patches/main-03-login.patch index c73e7ce..19b2856 100644 --- a/sources/patches/main-03-login.patch +++ b/sources/patches/main-03-login.patch @@ -36,10 +36,23 @@ index 5d564453d..9e3c5b55b 100644 })} diff --git a/app/scenes/Login/index.tsx b/app/scenes/Login/index.tsx -index 9a9650b48..5357d5cf5 100644 +index 9a9650b48..e642869b1 100644 --- a/app/scenes/Login/index.tsx +++ b/app/scenes/Login/index.tsx -@@ -264,7 +264,7 @@ function Login({ children }: Props) { +@@ -228,12 +228,6 @@ function Login({ children }: Props) { + ); + } + +- // If there is only one provider and it's OIDC, redirect immediately. +- if (config.providers.length === 1 && config.providers[0].id === "oidc") { +- window.location.href = getRedirectUrl(config.providers[0].authUrl); +- return null; +- } +- + return ( + + +@@ -264,7 +258,7 @@ function Login({ children }: Props) { ) : ( <> @@ -48,7 +61,7 @@ index 9a9650b48..5357d5cf5 100644 authProviderName: config.name || env.APP_NAME, })} -@@ -282,7 +282,7 @@ function Login({ children }: Props) { +@@ -282,7 +276,7 @@ function Login({ children }: Props) { {hasMultipleProviders && ( <>