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

Bug: Wrong return type on getUserOrganizations() #211

Open
4 tasks done
drochag opened this issue Sep 20, 2024 · 5 comments
Open
4 tasks done

Bug: Wrong return type on getUserOrganizations() #211

drochag opened this issue Sep 20, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@drochag
Copy link

drochag commented Sep 20, 2024

Prerequisites

Describe the issue

When using useKindeBrowserClient, getUserOrganizations() and userOrganizations are arays on page load as opposed to KindeOrganiztions or KindeOrganizations | null as mentioned, breaking the typings

const { userOrganizations, getUserOrganizations } = useKindeBrowserClient();
const userOrgs = getUserOrganizations();

console.log('userOrganizations', userOrganizations, `isArray: ${Array.isArray(userOrganizations)}`);
console.log('userOrgs', userOrgs, `isArray: ${Array.isArray(userOrgs)}`);

Screenshot 2024-09-20 at 3 32 33 a m

Library URL

https://github.com/kinde-oss/kinde-auth-nextjs

Library version

2.3.8

Operating system(s)

macOS

Operating system version(s)

Sonoma 14.6

Further environment details

No response

Reproducible test case URL

drochag/kinde-nextjs-app-router-starter-kit#1

Additional information

No response

@drochag drochag added the bug Something isn't working label Sep 20, 2024
@peterphanouvong
Copy link
Collaborator

Thanks @drochag, I'll push a fix for this

@leonardocintra
Copy link

leonardocintra commented Nov 30, 2024

  const { getOrganization, getUser } = getKindeServerSession();
  const organization = await getOrganization();

The return after creating the organization is coming up empty, would it be cache?

{
  orgCode: null,
  orgName: null,
  properties: {
    city: undefined,
    industry: undefined,
    postcode: undefined,
    state_region: undefined,
    street_address: undefined,
    street_address_2: undefined
  }
}

If I log out and log in again, the organization's data appears filled in

{
  orgCode: 'org_0b1ya25073391',
  orgName: null,
  properties: {
    city: undefined,
    industry: undefined,
    postcode: undefined,
    state_region: undefined,
    street_address: undefined,
    street_address_2: undefined
  }
}

image

@drochag
Copy link
Author

drochag commented Nov 30, 2024

@leonardocintra it was never solved, sadly we walked away from Kinde

@leonardocintra
Copy link

@leonardocintra it was never solved, sadly we walked away from Kinde

which application are you using now? @drochag

@drochag
Copy link
Author

drochag commented Dec 2, 2024

Just AuthJS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants