(tokens: TokenResponse)
| 63 | } |
| 64 | |
| 65 | export function extractAccountId(tokens: TokenResponse): string | undefined { |
| 66 | if (tokens.id_token) { |
| 67 | const claims = parseJwtClaims(tokens.id_token) |
| 68 | const accountId = claims && extractAccountIdFromClaims(claims) |
| 69 | if (accountId) return accountId |
| 70 | } |
| 71 | if (tokens.access_token) { |
| 72 | const claims = parseJwtClaims(tokens.access_token) |
| 73 | return claims ? extractAccountIdFromClaims(claims) : undefined |
| 74 | } |
| 75 | return undefined |
| 76 | } |
| 77 | |
| 78 | function buildAuthorizeUrl(redirectUri: string, pkce: PkceCodes, state: string): string { |
| 79 | const params = new URLSearchParams({ |
no test coverage detected