kinde-oss / kinde-auth-nextjs

Kinde NextJS SDK - authentication for server rendered apps
https://kinde.com/docs/developer-tools/nextjs-sdk/
MIT License
132 stars 17 forks source link

Bug: organization, getOrganization returning string instead of KindeOrganization #148

Open Thinkscape opened 2 months ago

Thinkscape commented 2 months ago

Prerequisites

Describe the issue

The TS types are lying:

export type KindeOrganization = {
  orgCode: string | null;
};
export type KindeState = {
  organization: KindeOrganization;
  getOrganization: () => KindeOrganization;
  getUserOrganizations: () => KindeOrganizations | null;
};

but when running the code I'm getting:

image

Library URL

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

Library version

2.2.3

Operating system(s)

macOS

Operating system version(s)

n/a

Further environment details

Next.js 14.2.2

Reproducible test case URL

No response

Additional information

No response

peterphanouvong commented 2 months ago

Thanks for raising @Thinkscape, we'll fix in the next release

Thinkscape commented 2 months ago

Mates, I'm on 2.2.5 and it's still borked.

image

The access token contains:

  "org_code": "org_REDACTED",
  "org_name": "Default Organization",

ps: I've taken a peek at #155 and it doesn't seem to include any updates to test suite... are there tests covering this sdk?