From 9fd00ae744569c3740474f12a4ce0ef4bbab25f9 Mon Sep 17 00:00:00 2001 From: Jared Perreault <90656038+jaredperreault-okta@users.noreply.github.com> Date: Tue, 29 Aug 2023 13:44:14 -0400 Subject: [PATCH] updates README (#265) OKTA-642714 updates README --- README.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 350d875b..83cf3ea4 100644 --- a/README.md +++ b/README.md @@ -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 ⚠️
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.

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][]. @@ -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 ⚠️
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.

See these [samples](https://github.com/okta/okta-react/tree/master/samples/routing) to get started ### General components @@ -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();