We have a web app running inside a mobile app on WebView and we are using Okta SDK
"@okta/okta-auth-js": "^7.3.0";
"@okta/okta-react": "^6.7.0";
Every hour, the signInWithRedirect
method experiences a delay, taking anywhere from 30 seconds to 2 minutes to complete. How can we mitigate this issue? A code sample is provided below.
const oktaCtx = useOktaAuth();
async function handleLoginOkta(state: any) {
try {
state = window.btoa(JSON.stringify(state));
if (oktaCtx) {
const isAuthenticated = oktaCtx?.authState?.isAuthenticated;
if (!isAuthenticated) await oktaCtx.oktaAuth.signInWithRedirect({ state }); // prettier-ignore
}
} catch (error: any) {
console.log(error);
}
}
This issue occurs exclusively within the native WebView component and does not happens in desktop or regular web browsers.