This repository has been archived by the owner on Oct 24, 2024. It is now read-only.
swiftone
released this
03 Mar 23:39
·
95 commits
to master
since this release
Features
- Now offers synchronous access to the authentication state (after the first asynchronous determination)
- Now offers the following React Hook (2.x requires React 16.8+)
useOktaAuth
- Now can be used with other routers than react-router
- React Router 5 continues to be supported, but is now optional
- Routers other than React-Router will have to write their own version of
LoginCallback
component
Breaking Changes
- Requires React 16.8+
- If using react-router, requires react-router 5+
- See the
Migration from 1.x to 2.0
section of the README for details on migrating your applicationsAuth.js
and theauth
parameter to<Security>
have been renamed toAuthService.js
andauthService
<ImplicitCallback>
has been replaced with<LoginCallback>
auth.IsAuthenticated()
has been removed- instead use the
.isAuthenticated
property of theauthState
object
- instead use the
withAuth
has been replaced withwithOktaAuth
, which gives slightly different parameters- provides
authService
instead ofauth
- also provides the
authState
object
- provides
- the arguments passed to the optional
onAuthRequired()
callback provided to the<Security>
component have changed - error handling for authentication is now handled by putting the error into the
authState.error
property auth.setFromUri()
is nowauthService.setFromUri()
and is passed a string (instead of an object)auth.getFromUri()
is nowauthService.getFromUri()
and returns a string (instead of an object)