kinde-auth-nextjs icon indicating copy to clipboard operation
kinde-auth-nextjs copied to clipboard

Bug: Wrong return type on `getUserOrganizations()`

Open drochag opened this issue 5 months ago • 1 comments

Prerequisites

  • [X] I have searched the repository’s issues and Kinde community to ensure my issue isn’t a duplicate
  • [X] I have checked the latest version of the library to replicate my issue
  • [X] I have read the contributing guidelines
  • [X] I agree to the terms within the code of conduct

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

https://github.com/drochag/kinde-nextjs-app-router-starter-kit/pull/1

Additional information

No response

drochag avatar Sep 20 '24 09:09 drochag