Skip to content

Commit

Permalink
wip: test redirect on staging
Browse files Browse the repository at this point in the history
going to deploy this code to staging and see if I can force
it to redirect to vercel on redirect after signing in.
  • Loading branch information
alishaevn committed Feb 6, 2024
1 parent 65bd696 commit 43f818a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ops/staging-deploy.tmpl.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
appBaseUrl: 'https://phenovista-staging.softserv.cloud'
clientBaseUrl: ''
clientBaseUrl: 'https://phenovista-test.vercel.app'
clientId: $CLIENT_ID
clientSecret: $CLIENT_SECRET
googleTagManagerId: ''
Expand Down
8 changes: 4 additions & 4 deletions pages/api/auth/[...nextauth].js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`

/**
* {
Expand Down

0 comments on commit 43f818a

Please sign in to comment.