From 200f6f54f8c346f4017ce637a151495678ebcaee Mon Sep 17 00:00:00 2001 From: dav Date: Sat, 13 Jul 2024 10:18:33 -0700 Subject: [PATCH] Add test auth button --- burrow-gtk/src/auth.rs | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/burrow-gtk/src/auth.rs b/burrow-gtk/src/auth.rs index f640431..3e65a8c 100644 --- a/burrow-gtk/src/auth.rs +++ b/burrow-gtk/src/auth.rs @@ -1,5 +1,5 @@ use reqwest::{Client, Method}; -use serde::Deserialize; +use serde::{Deserialize, Serialize}; use std::process::Command; use tokio::{ io::AsyncWriteExt, @@ -85,5 +85,22 @@ pub async fn slack_auth() { .await .unwrap(); - eprintln!("{:?}", res); + #[derive(Debug, Clone, Serialize)] + struct SlackAuthReq { + slack_token: String, + } + + let res = client + .post("https://burrow-hidden-pine-3298.fly.dev/slack-auth") + .json(&SlackAuthReq { + slack_token: res.id_token.unwrap(), + }) + .send() + .await + .unwrap() + .text() + .await + .unwrap(); + + println!("{:?}", res); }