-
Notifications
You must be signed in to change notification settings - Fork 290
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
feat(nextjs,backend,integration): Introduce dynamic keys from clerkMiddleware
#3525
Conversation
🦋 Changeset detectedLatest commit: c458ab7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 7 packages
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 |
clerkMiddleware
options to application serverclerkMiddleware
options to application server
4dd4f25
to
31cd84c
Compare
ecf05b8
to
daf8b1c
Compare
I know that this is still a draft PR, so don't worry about this comment yet. Once everything's is in place, let's also add an e2e test covering this flow. Feel free to ping anyone from team-sdk about this :) |
c3f1524
to
27ba688
Compare
c782f11
to
4c4ee19
Compare
9ba87be
to
99893b4
Compare
fffc077
to
220cff9
Compare
20adf12
to
a9c0509
Compare
a9c0509
to
c458ab7
Compare
❓ Why did we choose the approach of the cc: @LauraBeatris , @nikosdouvlis , @BRKalow |
Description
Resolves SDK-1253, SDK-1811, SDK-1770
This PR introduces dynamic keys from
clerkMiddleware
, solving the following problems:auth()
cannot assert the session token signature due to an undefined secret key, leading to a runtime error.auth.createRedirect
doesn't redirect tosignInUrl
orsignUpUrl
since those aren't propagated as well.The propagation is done by encrypting an
x-clerk-request-data
header and sending it from the middleware runtime to the application runtime, where it's going to be decrypted using a key. The key used for encryption is resolved based on the following conditions:secretKey
are provided, thenCLERK_ENCRYPTION_KEY
is requiredCLERK_SECRET_KEY
, which is going to have backward compatibility.Checklist
npm test
runs as expected.npm run build
runs as expected.Type of change