diff options
author | Akshay <[email protected]> | 2020-12-20 12:18:31 +0000 |
---|---|---|
committer | Akshay <[email protected]> | 2020-12-20 12:18:31 +0000 |
commit | 375fc45f310476a0a49fc48054f6563c8e02e2f6 (patch) | |
tree | c40bd576a8cc803051af234b9a30b0f3cb8f729e /src/handlers | |
parent | 8026ac574e6b8e1aeb868c970b780c72f655928b (diff) |
fix cookies/cors, more logging
Diffstat (limited to 'src/handlers')
-rw-r--r-- | src/handlers/rating.rs | 1 | ||||
-rw-r--r-- | src/handlers/users.rs | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/src/handlers/rating.rs b/src/handlers/rating.rs index 309c2c6..dfbeb3e 100644 --- a/src/handlers/rating.rs +++ b/src/handlers/rating.rs | |||
@@ -22,6 +22,7 @@ pub async fn add_rating( | |||
22 | pool: web::Data<TPool>, | 22 | pool: web::Data<TPool>, |
23 | ) -> impl Responder { | 23 | ) -> impl Responder { |
24 | info!("Add rating hit: {:?}", rating_details.product_id); | 24 | info!("Add rating hit: {:?}", rating_details.product_id); |
25 | info!("{:?}", cookie.identity()); | ||
25 | let conn = pool.get().unwrap(); | 26 | let conn = pool.get().unwrap(); |
26 | if let Some(uname) = cookie.identity() { | 27 | if let Some(uname) = cookie.identity() { |
27 | let selected_user = customer | 28 | let selected_user = customer |
diff --git a/src/handlers/users.rs b/src/handlers/users.rs index bff532c..73fca84 100644 --- a/src/handlers/users.rs +++ b/src/handlers/users.rs | |||
@@ -57,6 +57,10 @@ pub async fn login( | |||
57 | login_details: web::Json<Login>, | 57 | login_details: web::Json<Login>, |
58 | ) -> impl Responder { | 58 | ) -> impl Responder { |
59 | info!("Login hit"); | 59 | info!("Login hit"); |
60 | if let Some(uname) = cookie.identity() { | ||
61 | info!("Found existing cookie: {:?}", cookie.identity()); | ||
62 | return HttpResponse::Ok().finish(); | ||
63 | } | ||
60 | let conn = pool.get().unwrap(); | 64 | let conn = pool.get().unwrap(); |
61 | let entered_pass = &login_details.password; | 65 | let entered_pass = &login_details.password; |
62 | let selected_user = customer | 66 | let selected_user = customer |