box refresh token refreshes itself

This commit is contained in:
fyears 2024-06-14 00:41:50 +08:00
parent ce48f072cb
commit e3c53860f7

View File

@ -404,6 +404,8 @@ export class FakeFsBox extends FakeFs {
this.boxConfig.accessTokenExpiresInMs = k.expires_in * 1000; this.boxConfig.accessTokenExpiresInMs = k.expires_in * 1000;
this.boxConfig.accessTokenExpiresAtTimeMs = this.boxConfig.accessTokenExpiresAtTimeMs =
ts + k.expires_in * 1000 - 60 * 2 * 1000; ts + k.expires_in * 1000 - 60 * 2 * 1000;
this.boxConfig.refreshToken =
k.refresh_token || this.boxConfig.refreshToken;
await this.saveUpdatedConfigFunc(); await this.saveUpdatedConfigFunc();
console.info("Box accessToken updated"); console.info("Box accessToken updated");
return this.boxConfig.accessToken; return this.boxConfig.accessToken;