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