Repository navigation
fix(nextjs): Warn about missing encryption key while preserving keyless mode support - #4766
Merged
panteliselef merged 4 commits intoDec 12, 2024
Conversation
🦋 Changeset detectedLatest commit: b413d2c 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 |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
LauraBeatris
approved these changes
Dec 12, 2024
LauraBeatris
left a comment
Contributor
There was a problem hiding this comment.
Looks good! I've just left a couple of questions for clarification, no blockers tho
Co-authored-by: Laura Beatris <48022589+LauraBeatris@users.noreply.github.com>
panteliselef
force-pushed
the
elef/actls-34-investigate-missing-clerk_encryption_key-warning-in
branch
from
December 12, 2024 14:13
87b368d to
b413d2c
Compare
panteliselef
enabled auto-merge (squash)
December 12, 2024 14:14
panteliselef
deleted the
elef/actls-34-investigate-missing-clerk_encryption_key-warning-in
branch
December 12, 2024 14:20
jakobevangelista
pushed a commit
that referenced
this pull request
Jan 9, 2025
…ss mode support (#4766)
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
During rendering, both
await currentUser()andawait clerkClient()rely on the secret key being accessible, either through encrypted data or an environment variable. However, in Keyless mode, it is guaranteed that the secret key will not be available via an environment variable. Therefore, the secret key must be passed from the middleware to the rendering server.Previously, we merged
resolvedData(middleware options) with the pk and sk keys that exist in Keyless mode. In this PR, we ensure that the pk and sk keys from Keyless mode remain included in the encrypted data. Additionally, we refine the logic to correctly identify these keys, so the warning about a missingENCRYPTION_KEYis shown only when a secret key is explicitly passed as an option toclerkMiddleware.The bug was introduced in #4602
Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change