-
Notifications
You must be signed in to change notification settings - Fork 267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: AutoRenewService should perform renew if token has expired before service start #1354
Conversation
expect(client.tokenManager.renew).toHaveBeenCalledTimes(1); | ||
expect(client.tokenManager.renew).toHaveBeenCalledWith('test-idToken'); | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a test case which includes an expired token in the tokenManager before serviceManager.start
is called?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added
Maybe |
Codecov ReportBase: 91.77% // Head: 91.79% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #1354 +/- ##
==========================================
+ Coverage 91.77% 91.79% +0.02%
==========================================
Files 217 217
Lines 5206 5219 +13
Branches 1098 1100 +2
==========================================
+ Hits 4778 4791 +13
Misses 405 405
Partials 23 23
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
9fa72ee
to
66e049e
Compare
cb36530
to
1d6bf59
Compare
…e service start .
0551179
to
837f045
Compare
Fixes issue #1164
Issue description:
Leader election can take some time,
AutoRenewService
would not start until election is completed and current tab is a leader.If there is an expired token in storage on the moment
OktaAuth
service is started,TokenManager
would emitEVENT_EXPIRED
butAutoRenewService
would not catch/process this event because it's not started yet.Fix:
Process expired tokens on
AutoRenewService
start.Internal ref: https://oktainc.atlassian.net/browse/OKTA-549676