Skip to content

verifyToken

verifyToken(token, opts?): Promise<VerifyTokenResult>

Defined in: plugins/holocron-plugin-vercel/src/verify-token.ts:25

Checks a Vercel token by fetching the current user; the success subject is user @ followed by the email, username, name or id, the failure carries the error message.

A token scoped to one project cannot read the user (Vercel answers 403 or 404), so for those two answers the token is judged by listing its projects instead and the subject is scoped token (N projects). A 401, any other status and a failed project list are still a rejected token, and the message then names both calls.

string

VerifyTokenOptions = {}

Promise<VerifyTokenResult>