Commit 5417ea26 authored by Petter Goksøyr Åsen's avatar Petter Goksøyr Åsen
Browse files

DEICH-5850 periodically check auth status

parent 3ecc4feb
......@@ -56,6 +56,17 @@ class MyApp extends App {
this.loadPersonalData();
this.loadApplicationInfo();
// DEICH-5850 Periodically check if session is still OK, and redirect
// to login page if logged in and session is expired/invalid.
const reduxStore = this.props.reduxStore;
const authCheckInterval = 10000 // 10s
setInterval(async function() {
const isLoggedIn = await reduxStore.dispatch(getStatus());
if (window.location.pathname.startsWith("/min-side") && !isLoggedIn) {
window.location.href = "/logg-inn";
}
}, authCheckInterval);
// Global scroll restoration management
window.history.scrollRestoration = "manual";
const cachedScroll = [];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment