Version migration trouble

Though we’ve been using okta in our custom login screen, I’m personally new to okta so bear with me please. We’re on 2.x and want to migrate but when I do so, I run into what appears to be the 3rd party cookies issue with the following code (as an aside, I had to change oktaSignIn.session.get to oktaSignIn.authClient.session.get due to apparent api change):

var oktaSignIn = new OktaSignIn(config);
oktaSignIn.authClient.session.get(function (res) {
  resolve(res);
});

The call returns a 404 with body {“errorCode”:“E0000007”,“errorSummary”:“Not found: Resource not found: me (Session)”,“errorLink”:“E0000007”,“errorId”:“oaegCCR0rc3TTOa0oT5SZveDg”,“errorCauses”:[]}.

I’ve been doing a lot of searching on this subject and I can’t seem to find a path forward for our use case which would enable us to migrate. Once the “get” call completes, we use the status and login properties of the session object. How can I solve this migration issue?

This can be confusing. If you make a request to /sessions/me, and there is no active session, 404 is the expected response.

https://developer.okta.com/docs/reference/api/sessions/#get-current-session

1 Like

OK, thank you. That wasn’t the behavior in 2.x, so this was causing breakage upon migration. Appreciate the guidance!

I see the issue now… it wasn’t enough to add “authClient.” in my get call. I needed to move the callback function into a “.then()”. Thanks again for getting me on the right track.

1 Like

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