24 lines
717 B
TypeScript
24 lines
717 B
TypeScript
import { Connection } from 'typeorm';
|
|
import { UserToken } from './user-token.entity';
|
|
import { UserTOTPToken } from './user-totp-token.entity';
|
|
import { User } from './user.entity';
|
|
|
|
export const userProviders = [
|
|
{
|
|
provide: 'USER_REPOSITORY',
|
|
useFactory: (connection: Connection) => connection.getRepository(User),
|
|
inject: ['DATABASE_CONNECTION'],
|
|
},
|
|
{
|
|
provide: 'USER_TOKEN_REPOSITORY',
|
|
useFactory: (connection: Connection) => connection.getRepository(UserToken),
|
|
inject: ['DATABASE_CONNECTION'],
|
|
},
|
|
{
|
|
provide: 'USER_TOTP_TOKEN_REPOSITORY',
|
|
useFactory: (connection: Connection) =>
|
|
connection.getRepository(UserTOTPToken),
|
|
inject: ['DATABASE_CONNECTION'],
|
|
},
|
|
];
|