( clientSecret: string | null | undefined, method: ClientAuthMethod, )
| 543 | // ones, so an absent secret here unambiguously means "public client". The |
| 544 | // `method` only chooses HOW a present secret is sent (post vs basic). |
| 545 | const pickClientAuth = ( |
| 546 | clientSecret: string | null | undefined, |
| 547 | method: ClientAuthMethod, |
| 548 | ): oauth.ClientAuth => { |
| 549 | if (!clientSecret) return oauth.None(); |
| 550 | return method === "basic" |
| 551 | ? oauth.ClientSecretBasic(clientSecret) |
| 552 | : oauth.ClientSecretPost(clientSecret); |
| 553 | }; |
| 554 | |
| 555 | const tokenResponseFrom = (r: oauth.TokenEndpointResponse): OAuth2TokenResponse => ({ |
| 556 | access_token: r.access_token, |
no outgoing calls
no test coverage detected