feat: implement authentication module with JWT support and user management
This commit is contained in:
@@ -8,7 +8,13 @@ use std::sync::Arc;
|
||||
use axum::{Extension, Router};
|
||||
use migration::sea_orm::DatabaseConnection;
|
||||
|
||||
use crate::{middlewares, services::settings::SettingsStore};
|
||||
use crate::{
|
||||
middlewares,
|
||||
services::{
|
||||
auth::{authentication::AuthenticationService, user::UserService},
|
||||
settings::SettingsStore,
|
||||
},
|
||||
};
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct AppState {
|
||||
@@ -25,6 +31,10 @@ pub type ServiceState<T> = Arc<T>;
|
||||
pub struct AppService {
|
||||
#[allow(dead_code)] // TODO: remove when used
|
||||
pub settings: ServiceState<dyn SettingsStore>,
|
||||
#[allow(dead_code)] // TODO: remove when used
|
||||
pub authentication: ServiceState<dyn AuthenticationService>,
|
||||
#[allow(dead_code)] // TODO: remove when used
|
||||
pub user: ServiceState<dyn UserService>,
|
||||
}
|
||||
|
||||
pub fn get_root_router(state: impl Into<Arc<AppState>>) -> Router {
|
||||
|
||||
Reference in New Issue
Block a user