Files
imphnen-backend-service/imphnen-iam/src/v1/auth/mod.rs
T

52 lines
1.4 KiB
Rust
Raw Normal View History

2025-04-06 22:13:46 +07:00
use axum::{Router, routing::post};
2025-02-08 00:58:54 +07:00
2025-02-03 21:53:42 +07:00
pub mod auth_controller;
2025-02-07 22:26:32 +07:00
pub mod auth_dto;
2025-02-03 21:53:42 +07:00
pub mod auth_repository;
2025-03-21 17:00:19 +07:00
pub mod auth_schema;
2025-03-13 23:40:16 +07:00
pub mod auth_service;
pub mod google;
2025-02-08 00:58:54 +07:00
// Export only the essential types and functions from each submodule
pub use auth_dto::{
AuthLoginRequestDto,
AuthLoginResponsetDto,
AuthRegisterRequestDto,
AuthResendOtpRequestDto,
AuthVerifyEmailRequestDto,
AuthNewPasswordRequestDto,
AuthRefreshTokenRequestDto,
TokenDto,
UserCacheSchema,
};
pub use auth_repository::AuthRepository;
pub use imphnen_libs::AuthRepositoryTrait;
pub use auth_schema::AuthOtpSchema;
pub use auth_service::AuthServiceTrait;
// Export controller functions that are used in routing
pub use auth_controller::{
post_login,
post_login_mentor,
post_register,
post_forgot_password,
post_new_password,
post_refresh_token,
post_resend_otp,
post_verify_email
};
2025-02-08 00:58:54 +07:00
pub fn auth_router() -> Router {
2025-03-13 23:40:16 +07:00
Router::new()
.nest("/google", google::google_oauth_controller::GoogleOauthController::new().get_routes())
.route("/forgot", post(post_forgot_password))
.route("/login", post(post_login))
.route("/login-mentor", post(post_login_mentor))
.route("/new-password", post(post_new_password))
.route("/refresh", post(post_refresh_token))
.route("/register", post(post_register))
.route("/send-otp", post(post_resend_otp))
.route("/verify-email", post(post_verify_email))
2025-02-08 00:58:54 +07:00
}