twitchdev / twitch-cli

The official Twitch CLI to make developing on Twitch easier.
Apache License 2.0
604 stars 71 forks source link

[Feature Request] Implement usage of Refresh Token #307

Closed dichternebel closed 9 months ago

dichternebel commented 9 months ago

Tell us about your feature request

It would be great to see an implementation to get the possibility to use the Refresh Token for authorization of a user access. Currently I only see the possibility to take an existing Access Token and verify it. If this existing token is no longer valid we can not use the Refresh Token to generate a new Access Token but instead the current user has to deal with a browser popup.

I'm thinking of something like this: twitch token -r {RefreshToken} or twitch token --refresh {RefreshToken}

If refreshing is possible I would then expect that the new properties are stored and the CLI gives back a valid result like when calling twitch token -v {AccessToken}.

Disclaimer

Xemdo commented 9 months ago

Can be implemented as twitch token --refresh <refresh token> with optional flags --client-id and --secret. Currently there is no --secret flag so this will have to be implemented similar to --client-id

If --client-id is not specified, the results will be stored in the CLI's config file.