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

13 lines
347 B
TypeScript
Raw Normal View History

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