Skip to content

Commit

Permalink
refactor: debug
Browse files Browse the repository at this point in the history
  • Loading branch information
ChecksumDev committed Aug 11, 2023
1 parent 5b48c1a commit fa095cc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/users.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,18 +186,22 @@ pub async fn user_auth(

let github_user = minreq::get("https://api.github.com/user")
.with_header("User-Agent", "forge-registry")
.with_header("Accept", "application/vnd.github+json")
.with_header("Authorization", format!("Bearer {}", gat))
.send()
.unwrap();

let github_emails = minreq::get("https://api.github.com/user/emails")
.with_header("User-Agent", "forge-registry")
.with_header("Accept", "application/vnd.github+json")
.with_header("Authorization", format!("Bearer {}", gat))
.send()
.unwrap()
.json::<Vec<GithubEmail>>()
.unwrap();

log::debug!("{:?}", github_emails);

let primary_email = github_emails
.iter()
.find(|email| email.primary)
Expand All @@ -206,6 +210,7 @@ pub async fn user_auth(
.clone();

log::debug!("{}", github_user.as_str().unwrap());
log::debug!("{}", primary_email);
let github_user = serde_json::from_str::<GithubUser>(github_user.as_str().unwrap()).unwrap();

let mby_user = Users::find()
Expand Down

0 comments on commit fa095cc

Please sign in to comment.