From c93ec3248126411e283b5ad369a64d2507064ae2 Mon Sep 17 00:00:00 2001 From: alpaylan Date: Mon, 12 Apr 2021 02:17:44 +0300 Subject: start adding auth logic to transaction proposals. --- src/handlers.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/handlers.rs b/src/handlers.rs index bfd57bc..4c3f469 100644 --- a/src/handlers.rs +++ b/src/handlers.rs @@ -97,6 +97,19 @@ pub async fn propose_transaction( ) -> Result { debug!("new transaction request {:?}", new_transaction); + match db.users + .read() + .iter() + .find(|(uid, user)| user.public_key == new_transaction.target || + user.public_key == new_transaction.source) { + Some((uid, user)) => { + // let token = auth::create_jwt() + } + None => { + + } + + } // let mut transactions = db.lock().await; let mut transactions = db.pending_transactions.write(); -- cgit v1.2.3-70-g09d2