diff --git a/backend/src/handlers/auth.rs b/backend/src/handlers/auth.rs index 6dd911e..38be493 100644 --- a/backend/src/handlers/auth.rs +++ b/backend/src/handlers/auth.rs @@ -265,7 +265,7 @@ pub async fn update_user( .bind(body.first_name.to_owned()) .bind(body.last_name.to_owned()) .bind(body.username.to_owned()) - .bind(hashed_pwd) + .bind(&hashed_pwd) .bind(body.make_admin.to_owned()) .bind(id) .execute(&data.db) diff --git a/backend/src/router.rs b/backend/src/router.rs index 3638c56..96f7c59 100644 --- a/backend/src/router.rs +++ b/backend/src/router.rs @@ -27,7 +27,6 @@ pub fn create_router(state: Arc) -> Router { ) .route("/api/register", post(create_user)) .route("/api/users", get(get_users)) - .route("/api/users/current", get(get_current_user)) .route( "/api/users/{id}", get(get_user_by_id).delete(delete_user).patch(update_user), @@ -42,6 +41,7 @@ pub fn create_router(state: Arc) -> Router { .route("/api/tickets", get(get_tickets)) .route("/api/tickets/create", post(create_ticket)) .route("/api/logout", get(logout)) + .route("/api/users/current", get(get_current_user)) .layer(middleware::from_fn_with_state( state.clone(), validate_token,