Uh oh!
There was an error while loading. Please reload this page.
fix(nextjs): Drop user, session, organization from auth() - #1947
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 |
a6bfe10 to
866a06dCompare866a06d to
89f0185CompareUh oh!
There was an error while loading. Please reload this page.
dimkl
left a comment
There was a problem hiding this comment.
🔧 We should deprecate those return values in v4 before dropping them from auth() in v5.
Uh oh!
There was an error while loading. Please reload this page.
89f0185 to
1399570Compare| type GetAuthOpts = Partial<SecretKeyOrApiKey>; | ||
| type AuthObjectWithoutResources<T extends AuthObject> = Omit<T, 'user' | 'organization' | 'session'>; |
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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
clerk-cookie
commented
Oct 30, 2024
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. |
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