Replacement of oktaSignIn.hasTokensInUrl() in 5.x

I am tasked with upgrading our Okta signin widget from 4.x to 5.x in our application. The code we had used oktaSignIn.hasTokensInUrl() . Based on okta-signin-widget/MIGRATING.md at master · okta/okta-signin-widget · GitHub , “The widget no longer contains any logic to handle a redirect callback. If your app needs to handle a redirect callback, we recommend using @okta/okta-auth-js or one of our other client SDKs.” Can anyone suggest which particular function under okta/okta-auth-js to achieve the similar task? I guess we need to call thos function under oktaSignIn.authClient.x for okta-auth-js. Thanks.

Can you take a look at isLoginRedirect?

Thanks andrea for the suggestion. That’a one of the first things I tried when I looked at the document for okta-auth-js. I later found out that I also had to replace oktaSignIn.renderEl() with oktaSignIn.showSignInAndRedirect() to allow the authClient.isLoginRedirect() & autehClient.token.parseFromUrl() functions to get the token. It seems to work now after replacing these 2 functions.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.