Hello
We are using Okta inside a react SPA website, (okta/okta-react 3.0.2)
with asp.net MVC server side
and we are experiencing random redirects to login page.
the session time out is defined as 2 hours, but we are redirected after much less.
when redirected I see in the Chrome console the :
“redirectToLoginPage…”, Date() …
and it matches the code below…
code:
import { useHistory } from "react-router-dom";
import Security from "@okta/okta-react/dist/Security";
import React, { useEffect } from "react";
import Routes from "./routes";
import { OKTA } from "./config";
const App = () => {
const history = useHistory();
const redirectToLoginPage = () => {
console.log("redirectToLoginPage.........................", Date());
history.push("/login");
};
return (
<Security
issuer={OKTA.issuer}
client_id={OKTA.client_id}
redirect_uri={`${window.location.origin}/implicit/callback`}
onAuthRequired={redirectToLoginPage}
pkce
>
<Routes />
</Security>
);
};
export default App;
any suggestion will be appreciated