(token: string)
| 249 | |
| 250 | /** Validate a pasted token: well-formed JWT + accepted by the profile endpoint. */ |
| 251 | export async function verifyToken(token: string): Promise<ProfileData> { |
| 252 | if (token.split(".").length !== 3) { |
| 253 | throw new Error("That doesn't look like a valid token (expected a JWT)."); |
| 254 | } |
| 255 | return fetchProfile(token); |
| 256 | } |
no test coverage detected