Skip to main content
Module

x/cav/mod.ts>decodeJwt

A server framework for Deno
Go to Latest
function decodeJwt
Re-export
import { decodeJwt } from "https://deno.land/x/cav@0.0.24/mod.ts";

Verifies the JWT and returns its parsed payload object. If verification fails, an error will be thrown. Verification will fail if:

  • The header isn't { "alg": "HS256" } (temporary, WIP)
  • The JWT was signed with an unknown key
  • The signature doesn't match its header/payload

Multiple keys can be provided to handle key rollover. If no keys are provided, the module-level random fallback key will be used.

Parameters

jwt: string
optional
keys = [UNSUPPORTED]

Returns

Promise<unknown>