refactor(auth): LoginDeps, RegisterDeps, RefreshDeps, RegisterAndLoginDeps, RefreshSessionCleanupJob

This commit is contained in:
2026-06-11 22:58:42 +02:00
parent 70d1f10e3d
commit 9ca5ada924
18 changed files with 359 additions and 232 deletions

View 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,
}