Stone.js API
    Preparing search index...
    • Class decorator: authenticate every request, declaratively.

      @Auth() registers the authentication service provider (so constructor ({ auth }) works anywhere) and the kernel middleware that verifies the credentials carried by each request. Nothing is verified until you give it a signing strategy: a secret for HMAC, or a publicKey / jwksUri for asymmetric tokens.

      The declarative half of the pair; authBlueprint handed to defineStoneApp is the imperative one.

      Type Parameters

      • T extends ClassType = ClassType

      Parameters

      Returns ClassDecorator

      A class decorator.

      import { Auth } from '@stone-js/auth'

      @Auth({ secret: getString('JWT_SECRET'), issuer: 'https://issuer.example', audience: 'my-api' })
      @StoneApp({ name: 'my-app' })
      export class Application {}