taxum
    Preparing search index...

    Function jwtLayer

    • Layer to validate incoming JWTs.

      If verification succeeds, the decoded JWT is stored in the request's extensions under the JWT key.

      See JwtConfig for configuration.

      Parameters

      Returns Layer

      import {jwtLayer} from "@taxum/jwt";
      import {m, Router} from "@taxum/core/routing";

      const router = new Router()
      .route("/" m.get(() => "I'm protected!"))
      .layer(jwtLayer({
      key: new Uint8Array(),
      ));