Skip to content

Commit

Permalink
updates README (#265)
Browse files Browse the repository at this point in the history
OKTA-642714 updates README
  • Loading branch information
jaredperreault-okta authored Aug 29, 2023
1 parent 1ac0ee9 commit 9fd00ae
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,13 @@ Install peer dependencies
```bash
npm install --save react
npm install --save react-dom
npm install --save react-router-dom
npm install --save react-router-dom # see note below
npm install --save @okta/okta-auth-js # requires at least version 5.3.1
```

> ⚠️ NOTE ⚠️<br> The [SecureRoute](#secureroute) component packaged in this SDK only works with `react-router-dom` `5.x`.
If you're using `react-router-dom` `6.x`, you'll have to write your own `SecureRoute` component.<br><br>See these [samples](https://github.com/okta/okta-react/tree/master/samples/routing) to get started
## Usage

`okta-react` provides the means to connect a React SPA with Okta OIDC information. Most commonly, you will connect to a router library such as [react-router][].
Expand All @@ -108,7 +111,10 @@ npm install --save @okta/okta-auth-js # requires at least version 5.3.1

`okta-react` provides a number of pre-built components to connect a `react-router`-based SPA to Okta OIDC information. You can use these components directly, or use them as a basis for building your own components.

- [SecureRoute](#secureroute) - A normal `Route` except authentication is needed to render the component.
- [SecureRoute](#secureroute) - A normal `Route` except authentication is needed to render the component.

> ⚠️ NOTE ⚠️<br> The [SecureRoute](#secureroute) component packaged in this SDK only works with `react-router-dom` `5.x`.
If you're using `react-router-dom` `6.x`, you'll have to write your own `SecureRoute` component.<br><br>See these [samples](https://github.com/okta/okta-react/tree/master/samples/routing) to get started
### General components

Expand Down Expand Up @@ -315,7 +321,7 @@ export default withOktaAuth(class MessageList extends Component {
try {
const response = await fetch('http://localhost:{serverPort}/api/messages', {
headers: {
Authorization: 'Bearer ' + this.props.authState.accessToken
Authorization: 'Bearer ' + this.props.authState.accessToken.accessToken
}
});
const data = await response.json();
Expand Down

0 comments on commit 9fd00ae

Please sign in to comment.