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
As far as I understood, every session always has a identity in it's response.
This is also the case in the openapi spec under the session, where identity and id are set to be required fields.
But apparently the javascript/typescript client does not generate it as such, and generates it as a optional field in the Session type. This causes issues in our project down the road, because we would either have to do unnecessary checks all over the place just to satisfy TypeScript in that reagard, or overwrite your internal Session type such that the identity is not optional.
Reproducing the bug
Create a typescript project,
Call toSession({...}) on a FrontendApi client instance.
Try accessing the session.identity.id attribute, which fails
Note that typescript is telling you that the "identity might be undefined"
Preflight checklist
Ory Network Project
No response
Describe the bug
As far as I understood, every session always has a identity in it's response.
This is also the case in the openapi spec under the session, where
identity
andid
are set to be required fields.But apparently the javascript/typescript client does not generate it as such, and generates it as a optional field in the
Session
type. This causes issues in our project down the road, because we would either have to do unnecessary checks all over the place just to satisfy TypeScript in that reagard, or overwrite your internalSession
type such that the identity is not optional.Reproducing the bug
Create a typescript project,
toSession({...})
on aFrontendApi
client instance.session.identity.id
attribute, which failsRelevant log output
Relevant configuration
No response
Version
Kratos 1.0.0 and the latest npm client
On which operating system are you observing this issue?
Linux
In which environment are you deploying?
Docker
Additional Context
No response
The text was updated successfully, but these errors were encountered: