fix refresh token interval
This commit is contained in:
parent
d56e6f50ec
commit
6c1c6024f4
1 changed files with 3 additions and 2 deletions
|
|
@ -142,7 +142,7 @@ export class WorkOsAuthProvider implements AuthenticationProvider, Disposable {
|
|||
if (this._sessions[0].expiresIn) {
|
||||
setTimeout(
|
||||
() => this._refreshSessions(),
|
||||
(this._sessions[0].expiresIn * 1000 * 2) / 3,
|
||||
(this._sessions[0].expiresIn * 2) / 3,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -160,7 +160,8 @@ export class WorkOsAuthProvider implements AuthenticationProvider, Disposable {
|
|||
}),
|
||||
});
|
||||
if (!response.ok) {
|
||||
throw new Error("Network failure");
|
||||
const text = await response.text();
|
||||
throw new Error("Error refreshing token: " + text);
|
||||
}
|
||||
const data = (await response.json()) as any;
|
||||
return {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue