Skip to content

Commit

Permalink
chore: add some more logging to handlers (#1971)
Browse files Browse the repository at this point in the history
  • Loading branch information
ellie authored Apr 22, 2024
1 parent d239a67 commit bbf8380
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/atuin-server/src/handlers/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ pub async fn status<DB: Database>(
},
};

tracing::debug!(user = user.username, "requested sync status");

Ok(Json(StatusResponse {
count,
deleted,
Expand Down
3 changes: 3 additions & 0 deletions crates/atuin-server/src/handlers/user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,14 @@ pub async fn login<DB: Database>(
let verified = verify_str(user.password.as_str(), login.password.borrow());

if !verified {
debug!(user = user.username, "login failed");
return Err(
ErrorResponse::reply("password is not correct").with_status(StatusCode::UNAUTHORIZED)
);
}

debug!(user = user.username, "login success");

Ok(Json(LoginResponse {
session: session.token,
}))
Expand Down

0 comments on commit bbf8380

Please sign in to comment.