diff options
author | alpaylan | 2021-04-12 02:17:44 +0300 |
---|---|---|
committer | alpaylan | 2021-04-12 02:17:44 +0300 |
commit | c93ec3248126411e283b5ad369a64d2507064ae2 (patch) | |
tree | 7402995b90808e2a6408a323089319679ec78c37 | |
parent | 858d0a3d4ffa7b2aa2d3a47d82846259786b9882 (diff) | |
download | gradecoin-auth_dev.tar.gz gradecoin-auth_dev.tar.bz2 gradecoin-auth_dev.zip |
start adding auth logic to transaction proposals.auth_dev
-rw-r--r-- | src/handlers.rs | 13 |
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 | ||