( clientSecret: string | null | undefined, method: ClientAuthMethod, )
| 445 | // ones, so an absent secret here unambiguously means "public client". The |
| 446 | // `method` only chooses HOW a present secret is sent (post vs basic). |
| 447 | const pickClientAuth = ( |
| 448 | clientSecret: string | null | undefined, |
| 449 | method: ClientAuthMethod, |
| 450 | ): oauth.ClientAuth => { |
| 451 | if (!clientSecret) return oauth.None(); |
| 452 | return method === "basic" |
| 453 | ? oauth.ClientSecretBasic(clientSecret) |
| 454 | : oauth.ClientSecretPost(clientSecret); |
| 455 | }; |
| 456 | |
| 457 | const tokenResponseFrom = (r: oauth.TokenEndpointResponse): OAuth2TokenResponse => ({ |
| 458 | access_token: r.access_token, |
no outgoing calls
no test coverage detected