feat: basic auth

This commit is contained in:
Maulana Sodiqin
2025-03-14 09:53:20 +07:00
parent acfb8259bc
commit 9ffe808797
7 changed files with 166 additions and 80 deletions
+3 -5
View File
@@ -1,6 +1,4 @@
use super::{
mutation_login, mutation_register, AuthLoginRequestDto, AuthRegisterRequestDto,
};
use super::{AuthLoginRequestDto, AuthRegisterRequestDto, AuthService};
use crate::AppState;
use axum::{response::IntoResponse, Extension, Json};
@@ -8,12 +6,12 @@ pub async fn post_login(
Extension(state): Extension<AppState>,
Json(payload): Json<AuthLoginRequestDto>,
) -> impl IntoResponse {
mutation_login(payload, &state).await
AuthService::mutation_login(payload, &state).await
}
pub async fn post_register(
Extension(state): Extension<AppState>,
Json(payload): Json<AuthRegisterRequestDto>,
) -> impl IntoResponse {
mutation_register(payload, &state).await
AuthService::mutation_register(payload, &state).await
}