-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
easy refresh #160
easy refresh #160
Conversation
7ed3d5c
to
ba2fc21
Compare
src/tokens/user_token.rs
Outdated
@@ -150,6 +173,47 @@ impl UserToken { | |||
.map_err(|e| e.into_other()) | |||
} | |||
|
|||
/// Create a [UserToken] from an existing active user token or refresh token if the access token is expired. Retrieves [`login`](TwitchToken::login), [`client_id`](TwitchToken::client_id) and [`scopes`](TwitchToken::scopes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Create a [UserToken] from an existing active user token or refresh token if the access token is expired. Retrieves [`login`](TwitchToken::login), [`client_id`](TwitchToken::client_id) and [`scopes`](TwitchToken::scopes) | |
/// Create a [UserToken] from an existing active user token or refresh token if the access token is expired. Retrieves [`login`](TwitchToken::login), [`client_id`](TwitchToken::client_id) and [`scopes`](TwitchToken::scopes). |
src/tokens/user_token.rs
Outdated
@@ -112,9 +112,32 @@ impl UserToken { | |||
Self::from_existing(http_client, access_token, None, None).await | |||
} | |||
|
|||
/// Create a [UserToken] from a refresh token. Retrieves [`login`](TwitchToken::login), [`client_id`](TwitchToken::client_id) and [`scopes`](TwitchToken::scopes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Create a [UserToken] from a refresh token. Retrieves [`login`](TwitchToken::login), [`client_id`](TwitchToken::client_id) and [`scopes`](TwitchToken::scopes) | |
/// Create a [UserToken] from a refresh token. Retrieves [`login`](TwitchToken::login), [`client_id`](TwitchToken::client_id) and [`scopes`](TwitchToken::scopes). |
I think this should mention that it refreshes the token. Afaik, the passed token doesn't become invalid, but it's better to save the new refresh token.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was considering adding it but then decided against it. But if you think it should be there I'll agree
resolves #158