import {Instantiable, FactoryProducer} from '../../../di' import {TokenRepository} from '../types' import {ORMTokenRepository} from './ORMTokenRepository' import {ConfiguredSingletonFactory} from '../../../di/factory/ConfiguredSingletonFactory' /** * A dependency injection factory that matches the abstract TokenRepository class * and produces an instance of the configured repository driver implementation. */ @FactoryProducer() export class TokenRepositoryFactory extends ConfiguredSingletonFactory { protected getConfigKey(): string { return 'oauth2.repository.token' } protected getDefaultImplementation(): Instantiable { return ORMTokenRepository } protected getAbstractImplementation(): any { return TokenRepository } }