import type { AuthService } from './AuthService'; import { InMemoryAuthService } from './InMemoryAuthService'; import { getDIContainer } from '../di-container'; import { DI_TOKENS } from '../di-tokens'; export function getAuthService(): AuthService { const container = getDIContainer(); if (!container.isRegistered(DI_TOKENS.AuthService)) { throw new Error( `${DI_TOKENS.AuthService.description} not registered in DI container.`, ); } return container.resolve(DI_TOKENS.AuthService); }