Skip to content

zero-auth API Documentation v1.2.0


zero-auth API Documentation / verifyToken

Function: verifyToken()

verifyToken(token, secret): Promise<AuthUser>

Defined in: src/core/verify.ts:13

Verifies a JWT using HS256 and returns the decoded payload.

Parameters

token

string

The compact JWT string to verify.

secret

string

The signing secret.

Returns

Promise<AuthUser>

The decoded AuthUser payload.

Throws

with the appropriate code on any verification failure.