This commit is contained in:
2025-12-14 18:11:59 +01:00
parent acc15e8d8d
commit 217337862c
91 changed files with 5919 additions and 1999 deletions

View File

@@ -1,11 +1,14 @@
import type { AuthService } from './AuthService';
import { InMemoryAuthService } from './InMemoryAuthService';
let authService: AuthService | null = null;
import { getDIContainer } from '../di-container';
import { DI_TOKENS } from '../di-tokens';
export function getAuthService(): AuthService {
if (!authService) {
authService = new InMemoryAuthService();
const container = getDIContainer();
if (!container.isRegistered(DI_TOKENS.AuthService)) {
throw new Error(
`${DI_TOKENS.AuthService.description} not registered in DI container.`,
);
}
return authService;
return container.resolve<AuthService>(DI_TOKENS.AuthService);
}