Welcome to the Kinde community

Updated 11 months ago

TypeScript SDK issue

At a glance

The post describes an error that occurs when trying to retrieve user details, with the error message indicating that no authentication credential was found. Community members have started a discussion thread to consolidate information on this issue.

The KindeAI bot has responded with a link to a Discord conversation. A community member, @GlobalSystemMediaTransportContro, suggests that the issue may be related to the authorization code not being passed the authentication credentials, implying a potential bug with the Kinde library.

Another community member, @IkiTg07, notes that the error occurs when calling the getUser() function to retrieve user details and there is no user logged in. They question why this happens within the authorization code and suggest it should throw an error sooner.

In response, a community member explains that the referenced file in the TypeScript SDK contains a client that implements the authorization code flow, and the getUser() function checks whether the user is authenticated as the first step. The timing of when this function is called in the overall flow depends on the calling code, and without more context from the stack trace, it is difficult to determine if there is an appropriate earlier location to check for the issue.

Useful resources
Does anyone know where this error comes from ?
Plain Text
 βœ“ Compiled /api/auth/[kindeAuth] in 272ms (896 modules)
Error: Cannot get user details, no authentication credential found
    at eval (webpack-internal:///(rsc)/./node_modules/@kinde-oss/kinde-typescript-sdk/dist/sdk/clients/server/authorization-code.js:310:35)
    at step (webpack-internal:///(rsc)/./node_modules/@kinde-oss/kinde-typescript-sdk/dist/sdk/clients/server/authorization-code.js:123:23)
    at Object.eval [as next] (webpack-internal:///(rsc)/./node_modules/@kinde-oss/kinde-typescript-sdk/dist/sdk/clients/server/authorization-code.js:64:20)
    at fulfilled (webpack-internal:///(rsc)/./node_modules/@kinde-oss/kinde-typescript-sdk/dist/sdk/clients/server/authorization-code.js:27:32)
O
l
G
7 comments
Starting a thread here to consolidate the infromation on this issue.
@GlobalSystemMediaTransportContro said this:
just a hunch but this looks to be the authz code not being passed the auth creds from the authd code which would imply a bug with kinde
unless they conflated authz with authd... naughty!
I will pass this issue onto my TypeScript expert teammate tomorrow (Monday).
@IkiTg07 This error occurs when calling getUser() to retrieve user details and there is no user logged in. For reference, the location in source is here.

If there is any further context you can provide? Looks like this is perhaps a Next.js app?
I do have a question - how come this happens within authorization code? Shouldn't it throw a bit sooner?
In the context of the TypeScript SDK, the referenced file contains a client that implements the authorization code flow, with methods used to initiate and complete the flow. The getUser() function checks whether the user is authenticated as the first thing, when this is called in the overall flow depends on the calling code, as the provided stack trace doesn't show beyond the TS SDK, it is hard to say whether there is an appropriate earlier location to check.
Add a reply
Sign up and join the conversation on Discord