Skip to content
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

Auth object not updating after Leaving Organization (via OrganizationSwitcher) #4235

Open
4 tasks done
zammitjohn opened this issue Sep 27, 2024 · 0 comments
Open
4 tasks done

Comments

@zammitjohn
Copy link

zammitjohn commented Sep 27, 2024

Preliminary Checks

Reproduction

Always

Publishable key

pk_test_YWxpdmUtY2hpcG11bmstOTcuY2xlcmsuYWNjb3VudHMuZGV2JA

Description

Description:
I am using the auth() helper in a Next.js server component to return the Auth object of the currently active user. However, when I leave an organization using the OrganizationSwitcher, the Auth object does not update unless the page is reloaded (refreshed). As a result, the orgId value within the Auth object is not updated.

Steps to Reproduce:

  1. Use the auth() helper in a Next.js server component to get the Auth object.
  2. Leave (or delete) an organization using the OrganizationSwitcher.
  3. Observe that the Auth object does not change.
  4. Reload the page.
  5. Observe that the Auth object updates correctly.

Expected Behavior:
The Auth object should update immediately after leaving an organization without needing to reload the page.

Actual Behavior:
The Auth object remains unchanged until the page is reloaded.

Environment

npmPackages:
    @clerk/nextjs: ^5.6.2 => 5.6.2
    next: ^14.2.13 => 14.2.13
@zammitjohn zammitjohn added the needs-triage A ticket that needs to be triaged by a team member label Sep 27, 2024
@linear linear bot added confirmed and removed needs-triage A ticket that needs to be triaged by a team member labels Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant