Skip to content

Request to /authorize route when upgrading to v0.10.0 #64

@zkrzyzanowski

Description

@zkrzyzanowski

Hi there!
We're trying to upgrade authkit-react from 0.7.0 to the latest, 0.10.0. It works fine in our application, but we're having some issues getting our test suite passing.

In the latest version, there is a request/redirect to the /authorize endpoint on the workos API that I'm not quite sure how to mock correctly.

I've set up a reproduction in this repo. The main branch uses v0.10.0, while the 0.7.0 branch uses v0.7.0.

To reproduce:

  • Clone the repo and checkout main
  • touch .env
  • Add env vars for workos client
   VITE_WORKOS_CLIENT_ID="some_client_id"
   VITE_WORKOS_DEV_MODE="true"
  • Run npm install
  • Run npm run test
  • Click play on the only test in the suite and see it fail
    • Note, the test runner should have a logged in user. Instead, we see the log in screen
  • Checkout 0.7.0 branch
  • run npm install again to get the old version of authkit-react
  • Run npm run test again
  • Click play on the test, test passes

There seems to be a couple redirects through api.workos.com/user_management/ that we tried to mock in the test, but I don't think we have it quite right. Any suggestions on how to mock a response correctly here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions