From 71004302e3b0353b299f0fcba0a0c460977bcf36 Mon Sep 17 00:00:00 2001 From: Kirill Chernakov Date: Sun, 17 Nov 2024 15:36:58 +0400 Subject: [PATCH] Revert "fix: respect callbackUrl on signin redirect" This reverts commit cd30eba391fba023913f3149c367544515655001. --- keep-ui/pages/signin.tsx | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/keep-ui/pages/signin.tsx b/keep-ui/pages/signin.tsx index 8adabe83f..9c922f388 100644 --- a/keep-ui/pages/signin.tsx +++ b/keep-ui/pages/signin.tsx @@ -22,13 +22,8 @@ export async function getServerSideProps(context: any) { }; } -export default function SignIn({ - params, -}: { - params?: { amt: string; callbackUrl: string }; -}) { +export default function SignIn({ params }: { params?: { amt: string } }) { const [providers, setProviders] = useState(null); - const callbackUrl = params?.callbackUrl || "/"; useEffect(() => { async function fetchProviders() { @@ -45,25 +40,29 @@ export default function SignIn({ console.log("Signing in with auth0 provider"); if (params?.amt) { // Do we have a token from AWS Marketplace? redirect to auth0 with the token - signIn("auth0", { callbackUrl }, { acr_values: `amt:${params.amt}` }); + signIn( + "auth0", + { callbackUrl: "/" }, + { acr_values: `amt:${params.amt}` } + ); } else { - signIn("auth0", { callbackUrl }); + signIn("auth0", { callbackUrl: "/" }); } } else if (providers.credentials) { console.log("Signing in with credentials provider"); - signIn("credentials", { callbackUrl }); + signIn("credentials", { callbackUrl: "/" }); } else if (providers.keycloak) { console.log("Signing in with keycloak provider"); - signIn("keycloak", { callbackUrl }); + signIn("keycloak", { callbackUrl: "/" }); } else if (providers["azure-ad"]) { console.log("Signing in with Azure AD provider"); - signIn("azure-ad", { callbackUrl }); + signIn("azure-ad", { callbackUrl: "/" }); } else { console.log("No provider found"); console.log(providers); } } - }, [providers, params, callbackUrl]); + }, [providers, params]); return
Redirecting for authentication...
; }