feat: basic auth
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user