icynet-auth-server/src/modules/objects/oauth2-token/oauth2-token.providers.ts

13 lines
355 B
TypeScript
Raw Normal View History

import { Provider } from '@nestjs/common';
2022-03-09 18:37:04 +00:00
import { Connection } from 'typeorm';
import { OAuth2Token } from './oauth2-token.entity';
export const tokenProviders: Provider<any>[] = [
2022-03-09 18:37:04 +00:00
{
provide: 'TOKEN_REPOSITORY',
useFactory: (connection: Connection) =>
connection.getRepository(OAuth2Token),
inject: ['DATABASE_CONNECTION'],
},
];