Closed denysoblohin-okta closed 2 years ago
I think the issue comes from https://github.com/okta/okta-vue/blob/master/src/okta-vue.ts#L120, with the latest version of okta-auth-js, we should just call the oktaAuth.start(), then handleLoginRedirect should be able to update the tokens when it's finished.
This logic has been updated in okta-react and okta-angular, but by some reason this repo has been missed.
https://github.com/okta/okta-angular/blob/master/src/okta/okta.module.ts#L77 https://github.com/okta/okta-react/blob/master/src/Security.tsx#L72
Changed to always start service
@shuo Rebased onto 5.0
, added changelog (5.0.2)
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
After expiring of tokens when user tries to navigate to protected page,
navigationGuard
will be called._oktaAuth.isAuthenticated()
will return false, but_oktaAuth.authStateManager.getAuthState()
will containisAuthenticated: true
, soguardSecureRoute
will do nothing.Issue Number: OKTA-420066 Resolves #72
What is the new behavior?
Need to start oktaAuth service after
handleLoginRedirect()
call inLoginCallback
component. This wayisAuthenticated
will be correct.Does this PR introduce a breaking change?
Other information
Using okta-auth-js 5.4.3+ will fix issue (see comment) because of using default
autoRenew: true
inisAuthenticated()
call which will remove expired tokens.Updated
okta-auth-js
to^5.8.0
Reviewers