You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the response_type parameter is set by default to token. This means we can't refresh the access token obtained.
To refresh access tokens, access_type=offline has to be additionally passed while making the oauth request, which does not work with response_type=token. Instead, response_type must be set to code.
It is desired that if the user enters the refresh token (if they have it), youtube-deno handles the refresh flow and generates the new access token internally.
To achieve this:
Remove the default value of response_typefrom here and let the user enter it as a required parameter.
Change the second argument of the YouTube class to an object type, which can take three types of values: {access_token: "some-token"}, {refresh_token: "some-token"}, or {auth_code: "some-code"}.
If the access_token is directly passed, store it to the this.token class variable. Else if refresh_token is passed, trigger the refresh flow and the returned access token is stored in this.token. If auth_code is passed, exchange it for access_token and store it in this.token.
The text was updated successfully, but these errors were encountered:
Currently, the
response_type
parameter is set by default totoken
. This means we can't refresh the access token obtained.To refresh access tokens,
access_type=offline
has to be additionally passed while making the oauth request, which does not work withresponse_type=token
. Instead,response_type
must be set tocode
.It is desired that if the user enters the refresh token (if they have it), youtube-deno handles the refresh flow and generates the new access token internally.
To achieve this:
response_type
from here and let the user enter it as a required parameter.{access_token: "some-token"}
,{refresh_token: "some-token"}
, or{auth_code: "some-code"}
.this.token
class variable. Else if refresh_token is passed, trigger the refresh flow and the returned access token is stored inthis.token
. If auth_code is passed, exchange it for access_token and store it inthis.token
.The text was updated successfully, but these errors were encountered: