Skip to content
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

Merged
merged 2 commits into from
Nov 8, 2024

Conversation

dsinghvi
Copy link
Member

@dsinghvi dsinghvi commented Nov 8, 2024

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

@dsinghvi dsinghvi requested a review from abvthecity as a code owner November 8, 2024 12:10
Copy link

vercel bot commented Nov 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
rbac.ferndocs.com ❌ Failed (Inspect) Nov 8, 2024 3:51pm
1 Skipped Deployment
Name Status Preview Updated (UTC)
fern-shell ⬜️ Ignored (Inspect) Nov 8, 2024 3:51pm


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");
Copy link
Member Author

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

Copy link
Contributor

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)))

Copy link

github-actions bot commented Nov 8, 2024

📦 Next.js Bundle Analysis for fern-platform-monorepo

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

Copy link

github-actions bot commented Nov 8, 2024

PR Preview

Copy link

github-actions bot commented Nov 8, 2024

Playwright test results

passed  96 passed
flaky  2 flaky
skipped  3 skipped

Details

stats  101 tests across 10 suites
duration  1 minute, 38 seconds
commit  77afc66

Flaky tests

chromium › forward-proxy/nextjs.spec.ts › capture the flag
chromium › smoke/favicon.spec.ts › Check if favicon exists and URL does not return 404 for developers.gappify.com

Skipped tests

chromium › posthog.spec.ts › Posthog loads successfully
chromium › proxy.spec.ts › multipart-form upload
chromium › proxy.spec.ts › json request

@dsinghvi dsinghvi had a problem deploying to Preview - app-dev.buildwithfern.com November 8, 2024 15:51 — with GitHub Actions Failure
@dsinghvi dsinghvi merged commit db2586c into main Nov 8, 2024
15 of 18 checks passed
@dsinghvi dsinghvi deleted the dsinghvi/fix-authed-preview-production-redirect branch November 8, 2024 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants