-
Notifications
You must be signed in to change notification settings - Fork 253
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(nextjs): Support req.clerkUrl to fix issue with NextJS hostname on proxied apps #1394
Conversation
🦋 Changeset detectedLatest commit: f22c533 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
b0c275a
to
e416d36
Compare
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.
✅ Great news! Jit hasn't found any security issues in your PR. Good Job! 🏆
e416d36
to
4e42478
Compare
!snapshot |
Hey @dimkl - the snapshot version command generated the following package versions:
Tip: use the snippet copy button below to quickly install the required packages. # @clerk/backend
npm i @clerk/backend@0.23.5-snapshot.4e42478 # @clerk/chrome-extension
npm i @clerk/chrome-extension@0.3.15-snapshot.4e42478 # @clerk/clerk-js
npm i @clerk/clerk-js@4.50.0-snapshot.4e42478 # eslint-config-custom
npm i eslint-config-custom@0.3.0 # @clerk/clerk-expo
npm i @clerk/clerk-expo@0.18.6-snapshot.4e42478 # @clerk/fastify
npm i @clerk/fastify@0.5.4-snapshot.4e42478 # gatsby-plugin-clerk
npm i gatsby-plugin-clerk@4.3.16-snapshot.4e42478 # @clerk/localizations
npm i @clerk/localizations@1.21.0-snapshot.4e42478 # @clerk/nextjs
npm i @clerk/nextjs@4.21.8-snapshot.4e42478 # @clerk/clerk-react
npm i @clerk/clerk-react@4.20.5-snapshot.4e42478 # @clerk/remix
npm i @clerk/remix@2.6.13-snapshot.4e42478 # @clerk/clerk-sdk-node
npm i @clerk/clerk-sdk-node@4.10.12-snapshot.4e42478 # @clerk/shared
npm i @clerk/shared@0.19.1 # @clerk/themes
npm i @clerk/themes@1.7.5 # @clerk/types
npm i @clerk/types@3.46.0-snapshot.4e42478 |
b8dfa08
to
047a629
Compare
!snapshot |
Hey @nikosdouvlis - the snapshot version command generated the following package versions:
Tip: use the snippet copy button below to quickly install the required packages. # @clerk/backend
npm i @clerk/backend@0.23.5 # @clerk/chrome-extension
npm i @clerk/chrome-extension@0.3.15 # @clerk/clerk-js
npm i @clerk/clerk-js@4.50.0 # eslint-config-custom
npm i eslint-config-custom@0.3.0 # @clerk/clerk-expo
npm i @clerk/clerk-expo@0.18.6 # @clerk/fastify
npm i @clerk/fastify@0.5.4 # gatsby-plugin-clerk
npm i gatsby-plugin-clerk@4.3.16 # @clerk/localizations
npm i @clerk/localizations@1.21.0 # @clerk/nextjs
npm i @clerk/nextjs@4.21.9-snapshot.56dc3e3 # @clerk/clerk-react
npm i @clerk/clerk-react@4.20.5 # @clerk/remix
npm i @clerk/remix@2.6.13 # @clerk/clerk-sdk-node
npm i @clerk/clerk-sdk-node@4.10.12 # @clerk/shared
npm i @clerk/shared@0.19.1 # @clerk/themes
npm i @clerk/themes@1.7.5 # @clerk/types
npm i @clerk/types@3.46.0 |
56dc3e3
to
35a39c1
Compare
Introduced environment variable: CLERK_USE_X_FWD_HEADERS Provide `"true"` value to enable this. related NextJS issue: vercel/next.js#37536
72eb0f1
to
182f30d
Compare
@@ -17,6 +17,7 @@ export const PROXY_URL = process.env.NEXT_PUBLIC_CLERK_PROXY_URL || ''; | |||
export const IS_SATELLITE = process.env.NEXT_PUBLIC_CLERK_IS_SATELLITE === 'true' || false; | |||
export const SIGN_IN_URL = process.env.NEXT_PUBLIC_CLERK_SIGN_IN_URL || ''; | |||
export const SIGN_UP_URL = process.env.NEXT_PUBLIC_CLERK_SIGN_UP_URL || ''; | |||
export const TRUST_HOST = (process.env.CLERK_TRUST_HOST || process.env.CLERK_USE_X_FWD_HEADERS) === 'true'; |
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 believe we should try to inform the customers that have used it and drop the CLERK_USE_X_FWD_HEADERS
. Or somehow mark it as deprecated!
Issue: clerk#1413 PR introducing issue: clerk#1394
This PR has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Type of change
Packages affected
@clerk/clerk-js
@clerk/clerk-react
@clerk/nextjs
@clerk/remix
@clerk/types
@clerk/themes
@clerk/localizations
@clerk/clerk-expo
@clerk/backend
@clerk/clerk-sdk-node
@clerk/shared
@clerk/fastify
@clerk/chrome-extension
gatsby-plugin-clerk
build/tooling/chore
Description
npm test
runs as expected.npm run build
runs as expected.Add the
req.clerkUrl
and populate it using the forwarded headers if theCLERK_TRUST_HOST
environment variable is set to"true"
.This fix should resolve the incorrect hostname in the NextJS applications deployed outside the Vercel platform.