refactor(auth): LoginDeps, RegisterDeps, RefreshDeps, RegisterAndLoginDeps, RefreshSessionCleanupJob
This commit is contained in:
33
crates/application/src/auth/deps.rs
Normal file
33
crates/application/src/auth/deps.rs
Normal file
@@ -0,0 +1,33 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use domain::ports::{AuthService, PasswordHasher, RefreshSessionRepository, UserRepository};
|
||||
|
||||
use crate::config::AppConfig;
|
||||
|
||||
pub struct LoginDeps {
|
||||
pub user: Arc<dyn UserRepository>,
|
||||
pub password_hasher: Arc<dyn PasswordHasher>,
|
||||
pub auth: Arc<dyn AuthService>,
|
||||
pub refresh_session: Arc<dyn RefreshSessionRepository>,
|
||||
pub config: AppConfig,
|
||||
}
|
||||
|
||||
pub struct RegisterDeps {
|
||||
pub user: Arc<dyn UserRepository>,
|
||||
pub password_hasher: Arc<dyn PasswordHasher>,
|
||||
pub config: AppConfig,
|
||||
}
|
||||
|
||||
pub struct RefreshDeps {
|
||||
pub refresh_session: Arc<dyn RefreshSessionRepository>,
|
||||
pub auth: Arc<dyn AuthService>,
|
||||
pub config: AppConfig,
|
||||
}
|
||||
|
||||
pub struct RegisterAndLoginDeps {
|
||||
pub user: Arc<dyn UserRepository>,
|
||||
pub password_hasher: Arc<dyn PasswordHasher>,
|
||||
pub auth: Arc<dyn AuthService>,
|
||||
pub refresh_session: Arc<dyn RefreshSessionRepository>,
|
||||
pub config: AppConfig,
|
||||
}
|
||||
Reference in New Issue
Block a user