From ca5ac810bedd726d5225bb4af6f88ac4eb725498 Mon Sep 17 00:00:00 2001 From: jb-alvarado Date: Fri, 10 Jun 2022 16:15:52 +0200 Subject: [PATCH] add curl command --- src/api/routes.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/api/routes.rs b/src/api/routes.rs index 41a0e4f3..c0eef682 100644 --- a/src/api/routes.rs +++ b/src/api/routes.rs @@ -29,6 +29,8 @@ async fn settings(user: web::ReqData) -> Result", "password": ""}' --header 'Authorization: ' #[put("/user/{user_id}")] #[has_permissions("admin")] async fn update_user( @@ -68,8 +70,8 @@ async fn update_user( Err(ServiceError::Unauthorized) } -/// curl -X POST -H "Content-Type: application/json" -d '{"username": "USER", "password": "abc123" }' \ -/// http://127.0.0.1:8080/auth/login/ +/// curl -X POST http://127.0.0.1:8080/auth/login/ -H "Content-Type: application/json" \ +/// -d '{"username": "USER", "password": "abc123" }' #[post("/auth/login/")] pub async fn login(credentials: web::Json) -> impl Responder { match db_login(&credentials.username).await {