-
Notifications
You must be signed in to change notification settings - Fork 295
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
Pass clerkJSVersion
in interstitial
#1354
Changes from all commits
74a1282
942590e
c7d4ddf
29bd46e
fe3ca7b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
'@clerk/clerk-sdk-node': patch | ||
'@clerk/nextjs': patch | ||
'@clerk/remix': patch | ||
'@clerk/backend': patch | ||
--- | ||
|
||
Allow `clerkJSVersion` to be passed when loading interstitial. Support for | ||
- Nextjs | ||
- Remix | ||
- Node |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,8 @@ exports[`/server public exports should not include a breaking change 1`] = ` | |
"API_VERSION", | ||
"AllowlistIdentifier", | ||
"AuthStatus", | ||
"CLERK_JS_URL", | ||
"CLERK_JS_VERSION", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ❓ why are those exported? are we sure about this change? Aren't those internals? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is caused because of this export here. Probably will resolved in v5 |
||
"Clerk", | ||
"Client", | ||
"DOMAIN", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ import { constants, debugRequestState, loadInterstitialFromLocal } from '@clerk/ | |
import { json } from '@remix-run/server-runtime'; | ||
import cookie from 'cookie'; | ||
|
||
import { getEnvVariable } from '../utils'; | ||
import type { LoaderFunctionArgs, LoaderFunctionArgsWithAuth } from './types'; | ||
|
||
/** | ||
|
@@ -75,6 +76,10 @@ export const unknownResponse = (requestState: RequestState) => { | |
}; | ||
|
||
export const interstitialJsonResponse = (requestState: RequestState, opts: { loader: 'root' | 'nested' }) => { | ||
console.log('HEEEE', { | ||
clerkJSUrl: getEnvVariable('CLERK_JS'), | ||
clerkJSVersion: getEnvVariable('CLERK_JS_VERSION'), | ||
}); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✂️ |
||
return json( | ||
wrapWithClerkState({ | ||
__loader: opts.loader, | ||
|
@@ -84,6 +89,8 @@ export const interstitialJsonResponse = (requestState: RequestState, opts: { loa | |
publishableKey: requestState.publishableKey, | ||
// TODO: This needs to be the version of clerk/remix not clerk/react | ||
// pkgVersion: LIB_VERSION, | ||
clerkJSUrl: getEnvVariable('CLERK_JS'), | ||
clerkJSVersion: getEnvVariable('CLERK_JS_VERSION'), | ||
proxyUrl: requestState.proxyUrl, | ||
isSatellite: requestState.isSatellite, | ||
domain: requestState.domain, | ||
|
@@ -108,6 +115,8 @@ export const injectRequestStateIntoResponse = async (response: Response, request | |
__isSatellite: requestState.isSatellite, | ||
__signInUrl: requestState.signInUrl, | ||
__clerk_debug: debugRequestState(requestState), | ||
__clerkJSUrl: getEnvVariable('CLERK_JS'), | ||
__clerkJSVersion: getEnvVariable('CLERK_JS_VERSION'), | ||
}); | ||
// set the correct content-type header in case the user returned a `Response` directly | ||
// without setting the header, instead of using the `json()` helper | ||
|
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.
✅