KindeK
Kinde8mo ago
3 replies
MikeM

organizations name

I'm using the Nuxt module and trying to get the organizations array with both name and id fields like the one shown in the docs at https://docs.kinde.com/authenticate/manage-authentication/navigate-between-organizations/

I've been able to get the org_codes, but not the names. I'm equally happy with getting this value either client or server side. Any suggestions?

Details

Settings

The organizations claim is enabled in the ID Token is set per the attached screen shot.

Test code from Nuxt Server

import { defineEventHandler } from 'h3';


export default defineEventHandler(async (event) => {
    const client = event.context.kinde;
    console.log('getOrganization', await client.getOrganization())
    console.log(`.getClaim('org_name')`, await client.getClaim('org_name'))
    console.log('getUserOrganizations', await client.getUserOrganizations())

Results in:
getOrganization { orgCode: 'org_63d8e718863' }
.getClaim('org_name') { name: 'org_name', value: 'Default Organization' }
getUserOrganizations { orgCodes: [ 'org_63d8e718863', 'org_8f5c292370e' ] }
image.png
Kinde docs
Our developer tools provide everything you need to get started with Kinde.
Build a switch to navigate between organizations
Was this page helpful?