-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: authed previews in production redirect to the CDN URI #1803
fix: authed previews in production redirect to the CDN URI #1803
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
|
||
const redirectUri = process.env.NEXT_PUBLIC_CDN_URI != null | ||
? urlJoin(removeTrailingSlash(withDefaultProtocol(process.env.NEXT_PUBLIC_CDN_URI)), "/api/fern-docs/auth/sso/callback") | ||
: urlJoin(removeTrailingSlash(withDefaultProtocol(host)), "/api/fern-docs/auth/sso/callback"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the key logic change -- i added it for all callers, is that right? @abvthecity
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would do something like this:
String(new URL("/api/fern-docs/auth/sso/callback", withDefaultProtocol(process.env.NEXT_PUBLIC_CDN_URI ?? host)))
📦 Next.js Bundle Analysis for fern-platform-monorepoThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
Playwright test resultsDetails 101 tests across 10 suites Flaky testschromium › forward-proxy/nextjs.spec.ts › capture the flag Skipped testschromium › posthog.spec.ts › Posthog loads successfully |
Short description of the changes made
In production, we should redirect to
app.buildwithfern.com
What was the motivation & context behind this PR?
Make sure redirect URIs work in production WorkOS auth
How has this PR been tested?
N/A