You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
getIdToken is returning a promise and we're passing that directly to the jwtDecoder, I believe it needs to be awaited first.
I've implemented that change in a local copy of the repo and it works great now.
To replicate it, enable debug logging and try to access getIdToken from getKindeServerSession in a middleware or server component- it throws [TypeError: fe(...).getSessionItem is not a function] because we're not awaiting the creation of the session manager object and it then returns a null id token.
This was resolved in version 2.4.5, and downgrading fixes the error, but the issue was reintroduced in 2.4.6.
Prerequisites
Describe the issue
I've found a bug when attempting to access ID tokens in middleware or an SSR context on Next 15 - the initial pass always returns null.
I've narrowed it down to this line here
getIdToken
is returning a promise and we're passing that directly to thejwtDecoder
, I believe it needs to be awaited first.I've implemented that change in a local copy of the repo and it works great now.
To replicate it, enable debug logging and try to access
getIdToken
fromgetKindeServerSession
in a middleware or server component- it throws[TypeError: fe(...).getSessionItem is not a function]
because we're not awaiting the creation of the session manager object and it then returns a null id token.This was resolved in version 2.4.5, and downgrading fixes the error, but the issue was reintroduced in 2.4.6.
Library URL
https://github.com/kinde-oss/kinde-auth-nextjs
Library version
2.4.6
Operating system(s)
Windows
Operating system version(s)
11
Further environment details
No response
Reproducible test case URL
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: