feat: auth

This commit is contained in:
Maulana Sodiqin
2025-03-13 23:40:16 +07:00
parent 298144bd36
commit acfb8259bc
17 changed files with 226 additions and 179 deletions
+11 -3
View File
@@ -1,7 +1,8 @@
use axum::{response::IntoResponse, Extension, Json};
use super::{mutation_login, AuthLoginRequestDto};
use super::{
mutation_login, mutation_register, AuthLoginRequestDto, AuthRegisterRequestDto,
};
use crate::AppState;
use axum::{response::IntoResponse, Extension, Json};
pub async fn post_login(
Extension(state): Extension<AppState>,
@@ -9,3 +10,10 @@ pub async fn post_login(
) -> impl IntoResponse {
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
}