* Returns the auth client. * @param config options for the auth client.
(config: GoogleAuthOptions)
| 24 | * @param config options for the auth client. |
| 25 | */ |
| 26 | function getAuthClient(config: GoogleAuthOptions): GoogleAuth { |
| 27 | if (authClient) { |
| 28 | return authClient; |
| 29 | } |
| 30 | |
| 31 | const authConfig: GoogleAuthOptions = { |
| 32 | ...config, |
| 33 | clientOptions: { |
| 34 | ...config.clientOptions, |
| 35 | transporterOptions: { |
| 36 | ...config.clientOptions?.transporterOptions, |
| 37 | agent: apiv2.noKeepAliveAgent, |
| 38 | }, |
| 39 | }, |
| 40 | }; |
| 41 | |
| 42 | authClient = new GoogleAuth(authConfig); |
| 43 | return authClient; |
| 44 | } |
| 45 | |
| 46 | /** |
| 47 | * Retrieves and sets the access token for the current user. |
no outgoing calls
no test coverage detected
searching dependent graphs…