Skip to content

Commit

Permalink
Do not input id for login
Browse files Browse the repository at this point in the history
  • Loading branch information
pbzweihander committed Aug 15, 2023
1 parent 86b5461 commit 99e6ff3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions backend/src/handler/api/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ pub(super) fn create_router() -> Router {

#[derive(Deserialize, ToSchema)]
pub struct PostLoginReq {
id: String,
password: String,
hostname: String,
}
Expand All @@ -112,9 +111,8 @@ async fn post_login(
data: Data<State>,
Json(req): Json<PostLoginReq>,
) -> Result<Json<PostLoginResp>> {
if CONFIG.user_handle == req.id
&& bcrypt::verify(&req.password, &CONFIG.user_password_bcrypt)
.context_bad_request("failed to authenticate")?
if bcrypt::verify(&req.password, &CONFIG.user_password_bcrypt)
.context_bad_request("failed to authenticate")?
{
let access_key_activemodel = access_key::ActiveModel {
id: ActiveValue::Set(Ulid::new().into()),
Expand Down

0 comments on commit 99e6ff3

Please sign in to comment.