24 lines
850 B
TypeScript
24 lines
850 B
TypeScript
import {Instantiable, FactoryProducer} from '../../di'
|
|
import {AuthenticatableRepository} from '../types'
|
|
import {ORMUserRepository} from './orm/ORMUserRepository'
|
|
import {ConfiguredSingletonFactory} from '../../di/factory/ConfiguredSingletonFactory'
|
|
|
|
/**
|
|
* A dependency injection factory that matches the abstract ClientRepository class
|
|
* and produces an instance of the configured repository driver implementation.
|
|
*/
|
|
@FactoryProducer()
|
|
export class AuthenticatableRepositoryFactory extends ConfiguredSingletonFactory<AuthenticatableRepository> {
|
|
protected getConfigKey(): string {
|
|
return 'auth.storage'
|
|
}
|
|
|
|
protected getDefaultImplementation(): Instantiable<AuthenticatableRepository> {
|
|
return ORMUserRepository
|
|
}
|
|
|
|
protected getAbstractImplementation(): any {
|
|
return AuthenticatableRepository
|
|
}
|
|
}
|