From 4e5f1660d61d9d5c84fe024eed7ecb9aade695cc Mon Sep 17 00:00:00 2001 From: benthecarman Date: Thu, 19 Dec 2024 14:18:26 -0600 Subject: [PATCH] Add logs --- src/main.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 56cf4c0..84013c2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,7 +13,7 @@ use bitcoin_waila::PaymentParams; use jsonwebtoken::{encode, EncodingKey, Header}; use lnurl::withdraw::WithdrawalResponse; use lnurl::{AsyncClient, Tag}; -use log::error; +use log::{error, info, warn}; use nostr::key::Keys; use serde::Deserialize; use serde_json::{json, Value}; @@ -225,16 +225,19 @@ async fn github_callback( .map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?; // Find primary email - let primary_email = user_emails + let primary_email: GithubEmail = user_emails .into_iter() .find(|email| email.primary && email.verified) .ok_or(StatusCode::INTERNAL_SERVER_ERROR)?; // Check if user is banned if auth::is_banned(&primary_email.email) { + warn!("User {} is banned!", primary_email.email); return Err(StatusCode::INTERNAL_SERVER_ERROR); } + info!("Authing user with email: {}", primary_email.email); + // Create JWT let claims = auth::TokenClaims { sub: primary_email.email,