(methodID: Integration.MethodID, tokens: TokenResponse)
| 235 | } |
| 236 | |
| 237 | function credential(methodID: Integration.MethodID, tokens: TokenResponse) { |
| 238 | const accountID = extractAccountID(tokens) |
| 239 | return Credential.OAuth.make({ |
| 240 | type: "oauth", |
| 241 | methodID, |
| 242 | refresh: tokens.refresh_token, |
| 243 | access: tokens.access_token, |
| 244 | expires: Date.now() + (tokens.expires_in ?? 3600) * 1000, |
| 245 | metadata: accountID ? { accountID } : undefined, |
| 246 | }) |
| 247 | } |
| 248 | |
| 249 | async function generatePKCE(): Promise<Pkce> { |
| 250 | const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~" |
no test coverage detected