Update password endpoint #8
@@ -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,
|
||||
|
||||
+2
-2
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user