diff --git a/src/callers/login.rs b/src/callers/login.rs index 1104cad..60ad921 100644 --- a/src/callers/login.rs +++ b/src/callers/login.rs @@ -49,9 +49,9 @@ pub mod request { impl UpdatePasswordRequest { pub fn is_valid(&self) -> bool { if self.user_id.is_nil() - || !self.current_password.is_empty() - || !self.updated_password.is_empty() - || !self.confirmed_password.is_empty() + || self.current_password.is_empty() + || self.updated_password.is_empty() + || self.confirmed_password.is_empty() { false } else { @@ -540,7 +540,7 @@ pub async fn refresh_token( /// Endpoint for a updating password #[utoipa::path( - post, + patch, path = super::endpoints::UPDATE_PASSWORD, request_body( content = request::UpdatePasswordRequest, diff --git a/src/lib.rs b/src/lib.rs index 34841f0..fbfa407 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -8,7 +8,7 @@ pub mod token_stuff; pub mod init { use axum::{ Router, - routing::{get, post}, + routing::{get, patch, post}, }; use utoipa::OpenApi; @@ -112,7 +112,7 @@ pub mod init { ) .route( callers::endpoints::UPDATE_PASSWORD, - post(callers::login::update_password), + patch(callers::login::update_password), ) .layer(cors::configure_cors().await) }