fix(nextjs): Drop user, session, organization from auth()#1947
Merged
Conversation
🦋 Changeset detectedLatest commit: 1399570 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 |
panteliselef
force-pushed
the
SDK-696-deprecate-resources
branch
from
October 26, 2023 19:24
a6bfe10 to
866a06d
Compare
panteliselef
marked this pull request as ready for review
October 26, 2023 19:29
tmilewski
approved these changes
Oct 27, 2023
panteliselef
force-pushed
the
SDK-696-deprecate-resources
branch
from
October 29, 2023 21:08
866a06d to
89f0185
Compare
panteliselef
added this pull request to the merge queue
Oct 29, 2023
panteliselef
removed this pull request from the merge queue due to a manual request
Oct 29, 2023
panteliselef
added this pull request to the merge queue
Oct 30, 2023
dimkl
reviewed
Oct 30, 2023
dimkl
left a comment
Contributor
There was a problem hiding this comment.
🔧 We should deprecate those return values in v4 before dropping them from auth() in v5.
dimkl
removed this pull request from the merge queue due to a manual request
Oct 30, 2023
panteliselef
force-pushed
the
SDK-696-deprecate-resources
branch
from
October 30, 2023 09:34
89f0185 to
1399570
Compare
24 tasks
nikosdouvlis
approved these changes
Oct 30, 2023
|
|
||
| type GetAuthOpts = Partial<SecretKeyOrApiKey>; | ||
|
|
||
| type AuthObjectWithoutResources<T extends AuthObject> = Omit<T, 'user' | 'organization' | 'session'>; |
Member
There was a problem hiding this comment.
Note: we need to rethink how the backend types propagate, as I think we shouldn't resort to this low-level workarounds here. This PR is fine as we need a quick fix, but we should revisit in the future
panteliselef
added this pull request to the merge queue
Oct 30, 2023
dimkl
removed this pull request from the merge queue due to a manual request
Oct 30, 2023
dimkl
added this pull request to the merge queue
Oct 30, 2023
github-merge-queue
Bot
removed this pull request from the merge queue due to no response for status checks
Oct 30, 2023
panteliselef
added this pull request to the merge queue
Oct 30, 2023
tmilewski
pushed a commit
that referenced
this pull request
Nov 17, 2023
Collaborator
|
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. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
In this PR we are dropping
user,session, andorganizationresouces from the returned value ofauth(). They were never officially supported as the middleware didn't support types forloadUser,loadSession.Although by passing the types errors you could still load the resources. We consider bad practice to have extra 1-3 requests for each request that middleware captures so we should not allow developers to expect the resources returned from auth will be populated.
Checklist
npm testruns as expected.npm run buildruns as expected.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-extensiongatsby-plugin-clerkbuild/tooling/chore