generateJwt
constgenerateJwt: (config?) =>Policy
Defined in: src/policies/auth/generate-jwt.ts:85
Mint JWTs and attach them to the request for upstream consumption.
Parameters
Section titled “Parameters”config?
Section titled “config?”Returns
Section titled “Returns”Example
Section titled “Example”import { generateJwt } from "@homegrower-club/stoma";
generateJwt({ algorithm: "HS256", secret: env.JWT_SIGNING_SECRET, claims: (c) => ({ sub: c.req.header("x-user-id") }), issuer: "my-gateway", expiresIn: 300,});