diff options
author | Akshay <[email protected]> | 2020-12-26 05:21:46 +0000 |
---|---|---|
committer | Akshay <[email protected]> | 2020-12-26 05:21:46 +0000 |
commit | 8014def1a8da3397d78d1162f9e1b8c3f22d0322 (patch) | |
tree | 346e1de0ac6aa4ca973c1b3e5897c2c44948e5a8 /backend/src/handlers/users.rs | |
parent | 7c6006e1abc6094b5922ab69ccfa5449b8dbbc99 (diff) |
add transactions and quantities
- backend exposes endpoints to perform transactions
- frontend introduces a new page to "checkout" cart
Diffstat (limited to 'backend/src/handlers/users.rs')
-rw-r--r-- | backend/src/handlers/users.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/backend/src/handlers/users.rs b/backend/src/handlers/users.rs index 24fb591..a043c1f 100644 --- a/backend/src/handlers/users.rs +++ b/backend/src/handlers/users.rs | |||
@@ -58,7 +58,7 @@ pub async fn login( | |||
58 | login_details: web::Json<Login>, | 58 | login_details: web::Json<Login>, |
59 | ) -> impl Responder { | 59 | ) -> impl Responder { |
60 | info!("Login hit"); | 60 | info!("Login hit"); |
61 | if let Some(uname) = cookie.identity() { | 61 | if cookie.identity().is_some() { |
62 | info!("Found existing cookie: {:?}", cookie.identity()); | 62 | info!("Found existing cookie: {:?}", cookie.identity()); |
63 | return HttpResponse::Ok().finish(); | 63 | return HttpResponse::Ok().finish(); |
64 | } | 64 | } |
@@ -84,7 +84,7 @@ pub async fn login( | |||
84 | 84 | ||
85 | pub async fn logout(cookie: Identity) -> impl Responder { | 85 | pub async fn logout(cookie: Identity) -> impl Responder { |
86 | cookie.forget(); | 86 | cookie.forget(); |
87 | HttpResponse::Found().header("location", "/").finish() | 87 | HttpResponse::Ok().body("Successful logout.") |
88 | } | 88 | } |
89 | 89 | ||
90 | pub async fn user_details( | 90 | pub async fn user_details( |