Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/deno_nest/modules/jwt/deps.ts

Refer to nestjs to realize some common functions for Deno, support hono and oak
Latest
import * as denoNest from "https://deno.land/x/deno_nest@v3.15.1/modules/jwt/deps.ts";

Functions

Takes Header, Payload and CryptoKey and returns the url-safe encoded jwt.

This helper function simplifies setting a NumericDate. It takes either a Date object or a number (in seconds) and returns the number of seconds from 1970-01-01T00:00:00Z UTC until the specified UTC date/time.

Takes jwt, CryptoKey and VerifyOptions and returns the Payload of the jwt if the jwt is valid. Otherwise it throws an Error.

Interfaces

JWT §1: JWTs encode claims to be transmitted as a JSON [RFC7159] object [...]. JWT §4.1: The following Claim Names are registered in the IANA "JSON Web Token Claims" registry established by Section 10.1. None of the claims defined below are intended to be mandatory to use or implement in all cases, but rather they provide a starting point for a set of useful, interoperable claims. Applications using JWTs should define which specific claims they use and when they are required or optional.