Skip to content

Bug: Cookie not set during initial code exchange #59

@coel

Description

@coel

Prerequisites

Describe the issue

In order to maintain a session without exposing the tokens to client code, Kinde sets a cookie (when using custom domains only). This cookie is only set when the fetch has credentials set to include. The SDK does this when refreshing the token, but not when initially exchanging for the token after auth.

Work around is after calling handleRedirectToApp() to call refreshTokens() which does a token refresh and sets the cookie.

Reference for how this is handled in the other JS SDK: https://github.com/kinde-oss/kinde-auth-pkce-js/blob/main/src/createKindeClient.ts#L285

Library URL

https://github.com/kinde-oss/kinde-typescript-sdk

Library version

2.8.0

Operating system(s)

macOS

Operating system version(s)

Sonoma 14.4.1

Further environment details

No response

Reproducible test case URL

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions