-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
303: fix lifetimes issues r=Emilgardis a=Emilgardis resolves #236 Co-authored-by: Emil Gardström <emil.gardstrom@gmail.com>
- Loading branch information
Showing
17 changed files
with
179 additions
and
175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[package] | ||
name = "twitch_oauth2-integration" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
twitch_api = { workspace = true, features = ["reqwest", "helix"] } | ||
twitch_oauth2 = { workspace = true } | ||
reqwest = { version = "0.11.13" } | ||
tokio = { version = "1.23.0", features = ["macros"] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
use twitch_api::{twitch_oauth2::*, *}; | ||
|
||
pub async fn get_auth_token_request( | ||
client: &TwitchClient<'_, reqwest::Client>, | ||
) -> Result<AppAccessToken, ()> { | ||
let client_id = ClientId::from("aaa"); | ||
let client_secret = ClientSecret::from("aaaa"); | ||
|
||
let token = | ||
AppAccessToken::get_app_access_token(client, client_id, client_secret, Scope::all()) | ||
.await | ||
.unwrap(); | ||
|
||
Ok(token) | ||
} | ||
|
||
pub fn tokio() { | ||
let client: TwitchClient<'static, reqwest::Client> = TwitchClient::new(); | ||
|
||
tokio::spawn({ | ||
async move { | ||
get_auth_token_request(&client).await.unwrap(); | ||
} | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.