aboutsummaryrefslogtreecommitdiffstats
path: root/src/handlers.rs
diff options
context:
space:
mode:
authoralpaylan2021-04-12 02:17:44 +0300
committeralpaylan2021-04-12 02:17:44 +0300
commitc93ec3248126411e283b5ad369a64d2507064ae2 (patch)
tree7402995b90808e2a6408a323089319679ec78c37 /src/handlers.rs
parent858d0a3d4ffa7b2aa2d3a47d82846259786b9882 (diff)
downloadgradecoin-auth_dev.tar.gz
gradecoin-auth_dev.tar.bz2
gradecoin-auth_dev.zip
start adding auth logic to transaction proposals.auth_dev
Diffstat (limited to 'src/handlers.rs')
-rw-r--r--src/handlers.rs13
1 files changed, 13 insertions, 0 deletions
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(
97) -> Result<impl warp::Reply, warp::Rejection> { 97) -> Result<impl warp::Reply, warp::Rejection> {
98 debug!("new transaction request {:?}", new_transaction); 98 debug!("new transaction request {:?}", new_transaction);
99 99
100 match db.users
101 .read()
102 .iter()
103 .find(|(uid, user)| user.public_key == new_transaction.target ||
104 user.public_key == new_transaction.source) {
105 Some((uid, user)) => {
106 // let token = auth::create_jwt()
107 }
108 None => {
109
110 }
111
112 }
100 // let mut transactions = db.lock().await; 113 // let mut transactions = db.lock().await;
101 let mut transactions = db.pending_transactions.write(); 114 let mut transactions = db.pending_transactions.write();
102 115