mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-18 20:12:12 +00:00
fix: race condition causing “update-credentials” to fire multiple times
This commit is contained in:
@@ -92,8 +92,7 @@ export default class HTTPClient {
|
||||
const oauth = this.#session.oauth;
|
||||
|
||||
if (oauth.validateCredentials()) {
|
||||
// Check if the access token is valid to avoid authorization errors.
|
||||
await oauth.checkAccessTokenValidity();
|
||||
await oauth.refreshIfRequired();
|
||||
|
||||
request_headers.set('authorization', `Bearer ${oauth.credentials.access_token}`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user