13 lines
355 B
TypeScript
13 lines
355 B
TypeScript
import { Provider } from '@nestjs/common';
|
|
import { Connection } from 'typeorm';
|
|
import { OAuth2Token } from './oauth2-token.entity';
|
|
|
|
export const tokenProviders: Provider<any>[] = [
|
|
{
|
|
provide: 'TOKEN_REPOSITORY',
|
|
useFactory: (connection: Connection) =>
|
|
connection.getRepository(OAuth2Token),
|
|
inject: ['DATABASE_CONNECTION'],
|
|
},
|
|
];
|