This repository was archived by the owner on Apr 13, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
This repository was archived by the owner on Apr 13, 2025. It is now read-only.
Token Refreshing of YouTube doesn't work #212
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't workingserviceRequires changes to a serviceRequires changes to a service
Milestone
Description
Description
The automatic token refreshing of the YouTube service doesn't work. The service works while the access token is valid. Once it is invalid because it didn't get refreshed and you do anything with the service it will create an error that no refresh token was provided.
As we are at YouTube auth anyway we can also implement saving of the tokens to the config.
How to reproduce
- Create a youtube service
- Wait for the access token to invalidade
- Do any API call
Error Log
UNHANDLED PROMISE REJECTION!
Error: No refresh token is set.
at OAuth2Client.refreshTokenNoCache (/home/pi/nodecg-io/node_modules/google-auth-library/build/src/auth/oauth2client.js:162:19)
at OAuth2Client.refreshToken (/home/pi/nodecg-io/node_modules/google-auth-library/build/src/auth/oauth2client.js:143:25)
at OAuth2Client.getRequestMetadataAsync (/home/pi/nodecg-io/node_modules/google-auth-library/build/src/auth/oauth2client.js:259:28)
at OAuth2Client.requestAsync (/home/pi/nodecg-io/node_modules/google-auth-library/build/src/auth/oauth2client.js:332:34)
at OAuth2Client.request (/home/pi/nodecg-io/node_modules/google-auth-library/build/src/auth/oauth2client.js:326:25)
at createAPIRequestAsync (/home/pi/nodecg-io/node_modules/googleapis-common/build/src/apirequest.js:273:31)
at Object.createAPIRequest (/home/pi/nodecg-io/node_modules/googleapis-common/build/src/apirequest.js:53:16)
at Resource$Playlists.list (/home/pi/nodecg-io/node_modules/googleapis/build/src/apis/youtube/v3.js:1815:44)
at Timeout._onTimeout (/home/pi/nodecg-io/samples/youtube-playlist/extension/index.js:11:49)
at listOnTimeout (internal/timers.js:554:17)
at processTimers (internal/timers.js:497:7)
References
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingserviceRequires changes to a serviceRequires changes to a service