K
Kinde•2mo ago
daraxdray

Fetching user's organization from Next.js SDK returns null and no name for organization returned.

No description
7 Replies
Yoshify
Yoshify•2mo ago
👋 hi @daraxdray! Could I please confirm that you've enabled the Organizations additional claim for your ID token in your application? See attached screenshot.
No description
daraxdray
daraxdrayOP•2mo ago
What part of the setting wil I find this
IkiTg07
IkiTg07•2mo ago
Go to your business -> view details of application -> Tokens -> scroll down to ID Token and click on customize
daraxdray
daraxdrayOP•2mo ago
Thank you, I have done as stated but i still get the organizations list as null. Thank you
IkiTg07
IkiTg07•2mo ago
Have you tried login out and back in ? Or try to refresh the user’s claims
daraxdray
daraxdrayOP•2mo ago
Yes I have done that I have refreshed and still get a null value
Ages
Ages•2d ago
Hi @daraxdray I'm sorry to hear you're still experiencing issues retrieving the organization list in your Next.js application. Let's explore some additional steps to resolve this problem: 1. Verify Token Customization Settings: - Ensure that both the Organizations (array) and Organization name claims are enabled in your ID token customization settings. To do this: - Navigate to your application's settings in your authentication provider's dashboard. - Go to the Tokens section. - Under ID Token, click on Customize. - Enable the Organizations (array) and Organization name claims. - Save the changes. 2. Update SDK to the Latest Version: - Ensure you're using the latest version of the Next.js SDK, as previous versions may have had issues related to organization retrieval. - Check the official repository or package manager for the latest version and update accordingly. 3. Refresh User Session: - After making changes to token settings, it's crucial to refresh the user's session to apply the new token configurations. - Log out and log back in to refresh the session. - Alternatively, implement a function to refresh the user's claims programmatically. 4. Check Server-Side Implementation: - Ensure that your server-side code correctly handles the retrieval of the user's session and tokens. - Verify that the function responsible for fetching the user's organizations is correctly implemented and that it properly parses the ID token to extract organization information. By following these steps, you should be able to resolve the issue with fetching the user's organization information. If the problem persists, fell free to reach out Hi @daraxdray , I wanted to follow up and see if you were able to resolve the issue with retrieving the organization list. Have you had a chance to try the suggestions I mentioned earlier? If you're still experiencing problems or have any further questions, feel free to reach out. Otherwise, I will consider closing this issue.

Did you find this page helpful?