This commit is contained in:
Brandon Thomas committed 2021-11-17 01:03:12 -05:00
1 parent 2514ec3356
commit 80db649b9f
4 files changed
+14 -3

No files matched your search

@@ -121,11 +121,13 @@ pub async fn oauth_end_enroll_from_redirect(
}
})?;
let user_id = user_token.user_id.to_string();
let auth_token = user_token.access_token.secret().to_string();
let refresh_token: Option<String> = user_token.refresh_token
.as_ref()
.map(|token| token.secret().to_string());
info!("User id: {:?}", user_id);
info!("Auth token: {:?}", auth_token);
info!("Refresh token: {:?}", refresh_token);
@@ -35,14 +35,20 @@ pub async fn obs_gateway_websocket_handler(
let r = client.try_next().await.unwrap();
error!("Twitch PubSub Result: {:?}", r);
// User: vocodes
let user_id = 652567283;
//let user_id = 652567283;
let user_id = server_state.twitch_oauth_temp.temp_oauth_user_id.parse::<u32>().unwrap();
let bit_topic = pubsub::channel_bits::ChannelBitsEventsV2 {
channel_id: user_id,
}.into_topic();
let topics = [bit_topic];
let sub_topic = pubsub::channel_subscriptions::ChannelSubscribeEventsV1 {
channel_id: user_id,
}.into_topic();
let topics = [bit_topic, sub_topic];
let auth_token = server_state.twitch_oauth_temp.temp_oauth_access_token.clone();
+2
View File
@@ -219,6 +219,7 @@ async fn main() -> AnyhowResult<()> {
"http://localhost:54321/twitch/oauth_redirect");
// TODO: These are temporary.
let temp_oauth_user_id = easyenv::get_env_string_or_default("TEMP_TWITCH_OAUTH_USER_ID", "");
let temp_oauth_access_token = easyenv::get_env_string_or_default("TEMP_TWITCH_OAUTH_ACCESS", "");
let temp_oauth_refresh_token = easyenv::get_env_string_or_default("TEMP_TWITCH_OAUTH_REFRESH", "");
@@ -237,6 +238,7 @@ async fn main() -> AnyhowResult<()> {
redirect_url: oauth_redirect_url,
},
twitch_oauth_temp: TwitchOauthTemp {
temp_oauth_user_id,
temp_oauth_access_token,
temp_oauth_refresh_token,
},
@@ -36,6 +36,7 @@ pub struct TwitchOauthSecrets {
#[deprecated]
#[derive(Clone)]
pub struct TwitchOauthTemp {
pub temp_oauth_user_id: String,
pub temp_oauth_access_token: String,
pub temp_oauth_refresh_token: String,
}