From 43f818a247b86a55a3a06c287eea50470c8e8d9d Mon Sep 17 00:00:00 2001 From: Alisha Evans Date: Tue, 6 Feb 2024 16:45:54 -0600 Subject: [PATCH] wip: test redirect on staging going to deploy this code to staging and see if I can force it to redirect to vercel on redirect after signing in. --- ops/staging-deploy.tmpl.yaml | 2 +- pages/api/auth/[...nextauth].js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ops/staging-deploy.tmpl.yaml b/ops/staging-deploy.tmpl.yaml index 6090175..02e64a3 100644 --- a/ops/staging-deploy.tmpl.yaml +++ b/ops/staging-deploy.tmpl.yaml @@ -1,5 +1,5 @@ appBaseUrl: 'https://phenovista-staging.softserv.cloud' -clientBaseUrl: '' +clientBaseUrl: 'https://phenovista-test.vercel.app' clientId: $CLIENT_ID clientSecret: $CLIENT_SECRET googleTagManagerId: '' diff --git a/pages/api/auth/[...nextauth].js b/pages/api/auth/[...nextauth].js index 282608c..d6bb92d 100644 --- a/pages/api/auth/[...nextauth].js +++ b/pages/api/auth/[...nextauth].js @@ -47,15 +47,15 @@ const authOptions = { * and what it expected. * ref: https://github.com/nextauthjs/next-auth/discussions/7491#discussioncomment-6166539 */ - const clientUrl = process.env.NEXT_PUBLIC_CLIENT_BASE_URL - const urlPathname = new URL(url).pathname + const clientUrl = process.env.NEXT_PUBLIC_CLIENT_BASE_URL + const urlPathname = new URL(url).pathname console.log({ url, baseUrl, clientUrl, urlPathname, }) - if (new URL(url).origin === process.env.NEXT_PUBLIC_CLIENT_BASE_URL) return `${clientUrl}${urlPathname}` + // if (new URL(url).origin === process.env.NEXT_PUBLIC_CLIENT_BASE_URL) return `${clientUrl}${urlPathname}` // return baseUrl - return url + return `${clientUrl}${urlPathname}` /** * {