Skip to content
This repository was archived by the owner on Apr 13, 2025. It is now read-only.

Commit 6eb967f

Browse files
committed
Fix youtube token refreshing by always prompting user for consent
Fixes #212. The problem is that the google oauth2 api only returns a refresh token if a confirmation prompt was displayed to the user. Previously if you logged in once it would use the session and automatically authenticate you. But then you don't have a refresh token and it fails because of that after about an hour. This creates the problem that everytime you need to select your Google account and click "OK" but I will create a followup PR to save the refresh token so you don't need to login each time and also it doesn't create a browser tab each time.
1 parent 4edf15e commit 6eb967f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

nodecg-io-youtube/extension/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class YoutubeService extends ServiceBundle<YoutubeServiceConfig, YoutubeServiceC
2929
const authUrl = auth.generateAuthUrl({
3030
access_type: "offline",
3131
scope: "https://www.googleapis.com/auth/youtube",
32+
prompt: "consent",
3233
});
3334

3435
return new Promise((resolve, reject) => {

0 commit comments

Comments
 (0)