Skip to content

Commit

Permalink
Add section about hash-mode routing
Browse files Browse the repository at this point in the history
After submitting authts#1270 I guess this is the way to go
  • Loading branch information
tennox authored and Chris Keogh committed Apr 3, 2024
1 parent 150c6e9 commit f3eead8
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 f3eead8

Please sign in to comment.