( clientSecret: string | null | undefined, method: ClientAuthMethod, )
| 482 | // ones, so an absent secret here unambiguously means "public client". The |
| 483 | // `method` only chooses HOW a present secret is sent (post vs basic). |
| 484 | const pickClientAuth = ( |
| 485 | clientSecret: string | null | undefined, |
| 486 | method: ClientAuthMethod, |
| 487 | ): oauth.ClientAuth => { |
| 488 | if (!clientSecret) return oauth.None(); |
| 489 | return method === "basic" |
| 490 | ? oauth.ClientSecretBasic(clientSecret) |
| 491 | : oauth.ClientSecretPost(clientSecret); |
| 492 | }; |
| 493 | |
| 494 | const tokenResponseFrom = (r: oauth.TokenEndpointResponse): OAuth2TokenResponse => ({ |
| 495 | access_token: r.access_token, |
no outgoing calls
no test coverage detected