(providerConfig: any)
| 6 | const oauthClients = {}; |
| 7 | |
| 8 | export function getOAuthClient(providerConfig: any) { |
| 9 | const { name } = providerConfig; |
| 10 | if (!oauthClients[name]) { |
| 11 | oauthClients[name] = new AuthorizationCode({ |
| 12 | client: { |
| 13 | id: providerConfig.clientId, |
| 14 | secret: providerConfig.clientSecret, |
| 15 | }, |
| 16 | auth: { |
| 17 | tokenHost: providerConfig.tokenUrl, |
| 18 | authorizeHost: providerConfig.authorizationUrl, |
| 19 | }, |
| 20 | }); |
| 21 | } |
| 22 | return oauthClients[name]; |
| 23 | } |
| 24 |