Skip to content

Commit

Permalink
Add section about hash-mode routing
Browse files Browse the repository at this point in the history
After submitting #1270 I guess this is the way to go
  • Loading branch information
tennox authored Nov 28, 2023
1 parent b88ec90 commit cc5b51f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,13 @@ mgr.signinRedirect({ url_state: 'custom url state' })
The `url_state` will be appended to the opaque, unique value created by the library when sending the request. It should survive the round trip to your authentication server and will be part of the [User](classes/User.html#url_state) object as `url_state`.


# Hash-mode router (SPA)
If your app is using hash-based routing, be aware that many OIDC providers append the query string after the hash instead of inserting it before:
**Correct:** `https://your.org/?code=ab&state=cd#/oidc-callback`
**Wrong:** `https://your.org/#/oidc-callback?code=ab&state=cd`

Check out [this issue]([https://github.com/authts/oidc-client-ts/issues/734#issuecomment-1298381823](https://github.com/authts/oidc-client-ts/issues/734)) for details. (There are also workarounds, as long as your provider doesn't fix the issue)

# Projects using oidc-client-ts

- [React context provider](https://github.com/authts/react-oidc-context)
Expand Down

0 comments on commit cc5b51f

Please sign in to comment.