(authCode: string)
| 43 | } |
| 44 | |
| 45 | export function isCliAuthCodeCandidate(authCode: string): boolean { |
| 46 | if (isOpaqueCliAuthCodeToken(authCode)) { |
| 47 | return true |
| 48 | } |
| 49 | |
| 50 | const { fingerprintId, expiresAt, receivedHash } = |
| 51 | parseCliAuthCodeShape(authCode) |
| 52 | return ( |
| 53 | fingerprintId.length > 0 && |
| 54 | /^\d+$/.test(expiresAt) && |
| 55 | CLI_AUTH_CODE_HASH_RE.test(receivedHash) |
| 56 | ) |
| 57 | } |
| 58 | |
| 59 | export function getCliAuthOnboardSearchParams( |
| 60 | searchParams: URLSearchParams, |
no test coverage detected