(value: unknown)
| 127 | }; |
| 128 | |
| 129 | const parseApprovedAuth = (value: unknown): StoredAuth => { |
| 130 | const parsed = storedAuthSchema.safeParse(value); |
| 131 | |
| 132 | if (!parsed.success) { |
| 133 | throw new TypeError('Device auth poll response did not include a token.'); |
| 134 | } |
| 135 | |
| 136 | return { |
| 137 | token: parsed.data.token, |
| 138 | userEmail: parsed.data.userEmail, |
| 139 | }; |
| 140 | }; |
| 141 | |
| 142 | export const createDeviceAuthRequest = async ({ |
| 143 | apiBaseUrl, |
no outgoing calls
no test coverage detected