This repository has been archived on 2024-06-14. You can view files and clone it, but cannot push or open issues or pull requests.
icynet-auth-server/src/modules/objects/oauth2-client/oauth2-client.providers.ts

26 lines
818 B
TypeScript
Raw Normal View History

2022-03-09 18:37:04 +00:00
import { Connection } from 'typeorm';
import { OAuth2ClientAuthorization } from './oauth2-client-authorization.entity';
import { OAuth2ClientURL } from './oauth2-client-url.entity';
import { OAuth2Client } from './oauth2-client.entity';
export const clientProviders = [
{
provide: 'CLIENT_REPOSITORY',
useFactory: (connection: Connection) =>
connection.getRepository(OAuth2Client),
inject: ['DATABASE_CONNECTION'],
},
{
provide: 'CLIENT_URL_REPOSITORY',
useFactory: (connection: Connection) =>
connection.getRepository(OAuth2ClientURL),
inject: ['DATABASE_CONNECTION'],
},
{
provide: 'CLIENT_AUTHORIZATION_REPOSITORY',
useFactory: (connection: Connection) =>
connection.getRepository(OAuth2ClientAuthorization),
inject: ['DATABASE_CONNECTION'],
},
];