fief-dev / fief-js

Fief client for JavaScript
https://docs.fief.dev/integrate/javascript/
MIT License
9 stars 3 forks source link

Using `redirectToLogin` on an unknown workspace silently fail #7

Closed tito closed 1 year ago

tito commented 1 year ago

Describe the bug

If you use fiefAuth.redirectToLogin(...), and the workspace cannot be found, you'll have

End result is, in your app, you end up with redirecting with an url like http://.../undefined?response_type=code&client_id=.... And no clue why :)

To Reproduce

Steps to reproduce the behavior:

  1. Start empty instance of fief
  2. Run your code on this instance
  3. See error

Configuration

frankie567 commented 1 year ago

Good catch, @tito, thanks 🙏

I've added proper error handling for this in 0.13.5. You can look for FiefRequestError for those cases.