Elffuss BraidHub

kikocis/continue public

fix: always refresh with retries

Even if an access token is expired, the refresh token could be valid. They don't expire until much longer
Changeset3389e73db7c2b519f984fe5b60dd48e990831a24db852252362736cf7c8cb9eb
AuthorNate <sestinj@gmail.com> · 2025-07-07 22:59 -07:00
CommitterNate <sestinj@gmail.com> · 2025-07-07 22:59 -07:00
Parents01b1169c3d6e

Browse the files at this changeset

1 file changed

modified extensions/vscode/src/stubs/WorkOsAuthProvider.ts +3 −6
@@ -198,12 +198,9 @@
198198 const finalSessions = [];
199199 for (const session of sessions) {
200200 try {
201- // For expired tokens, don't use retries - if refresh fails, we drop the session
202- const refreshMethod = this.jwtIsExpiredOrInvalid(session.accessToken)
203- ? this._refreshSession.bind(this) // Direct refresh for expired tokens
204- : this._refreshSessionWithRetry.bind(this); // Retry for valid tokens
205-
206- const newSession = await refreshMethod(session.refreshToken);
201+ const newSession = await this._refreshSessionWithRetry(
202+ session.refreshToken,
203+ );
207204 finalSessions.push({
208205 ...session,
209206 accessToken: newSession.accessToken,