Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add section about hash-mode routing #1275

Merged
merged 1 commit into from
Dec 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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