2025-02-03 13:12:36 +00:00
|
|
|
import { createSequelizeTransactionManager } from "@common/infrastructure";
|
|
|
|
|
|
|
|
|
|
import { createAuthenticatedUserRepository } from "../infraestructure";
|
|
|
|
|
import { createPassportAuthProvider } from "../infraestructure/passport/passport-auth-provider";
|
|
|
|
|
import { IAuthProvider } from "./auth-provider.interface";
|
|
|
|
|
import { IAuthService } from "./auth-service.interface";
|
2025-02-01 21:48:13 +00:00
|
|
|
import { AuthService } from "./auth.service";
|
|
|
|
|
|
2025-02-03 13:12:36 +00:00
|
|
|
export * from "./auth-provider.interface";
|
|
|
|
|
export * from "./auth-service.interface";
|
2025-02-01 21:48:13 +00:00
|
|
|
|
2025-02-03 13:12:36 +00:00
|
|
|
export const createAuthService = (): IAuthService => {
|
|
|
|
|
const transactionManager = createSequelizeTransactionManager();
|
|
|
|
|
const authenticatedUserRepository = createAuthenticatedUserRepository();
|
2025-02-03 18:03:23 +00:00
|
|
|
|
|
|
|
|
const authProvider: IAuthProvider = createPassportAuthProvider(
|
|
|
|
|
authenticatedUserRepository,
|
|
|
|
|
transactionManager
|
|
|
|
|
);
|
2025-02-03 13:12:36 +00:00
|
|
|
return new AuthService(authenticatedUserRepository, transactionManager, authProvider);
|
|
|
|
|
};
|