You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update the values in src/config.js file to an Okta tenant you have access to.
Run a yarn && yarn start to install dependencies and start the app
Log into the app, and click the "Refresh entire application to test persistence" button (the app should load)
Uncomment line 12 in src/App.js and line 25 in src/components/Home.js (oktaAuth.start() and oktaAuth.stop())
Log into the app, and click the "Refresh entire application to test persistence" button (the app does not load)
Extra information about the use case/user story you are trying to implement
If a user is already logged into the app and chooses to refresh the page for whatever reason, the user should continue to be logged in and should continue to see the content of the app on the screen.
The actual state is read from storage and is passed to handlers subscribed with oktaAuth.authStateManager.subscribe (okta-react's <Security/> component does this only in useEffect, so it misses state update this at this point)
useEffect is called for <Security/> which starts oktaAuth service and now subscribes to oktaAuth.authStateManager
Looks like the fix would be to call oktaAuth.authStateManager.getAuthState()) in useEffect of <Security/>
I'm submitting a:
Current behavior
When a user is logged in, and a SPA is running Okta as a service, a page refresh won't render content to the DOM.
Expected behavior
When a user is logged in, and a SPA is running Okta as a service, a page refresh should render content to the DOM.
Minimal reproduction of the problem with instructions
src/config.js
file to an Okta tenant you have access to.yarn && yarn start
to install dependencies and start the appsrc/App.js
and line 25 insrc/components/Home.js
(oktaAuth.start()
andoktaAuth.stop()
)Extra information about the use case/user story you are trying to implement
If a user is already logged into the app and chooses to refresh the page for whatever reason, the user should continue to be logged in and should continue to see the content of the app on the screen.
Environment
node -v
): v14.16.0Configuration
Okta SPA Setup:
![Screen Shot 2021-10-06 at 2 03 31 PM](https://user-images.githubusercontent.com/32524021/136266792-76f03720-3615-4b58-82d0-f500ff84da5b.png)
The text was updated successfully, but these errors were encountered: