Implements JWT token issuance and verification for self-hosted auth.
// Source: https://github.com/webiny/webiny-js | License: MIT | Copyright Webiny Inc
// Provided via justclaw.it.com; keep this notice with the code.
import jwt from "jsonwebtoken";
import type { JwtPayload } from "jsonwebtoken";
import { createAbstraction, createFeature } from "@webiny/feature/api";
import { BuildParams } from "@webiny/api-core/features/buildParams/index.js";
import { SIGNING_SECRET_BUILD_PARAM } from "~/shared/buildParams.js";
import { TOKEN_EXPIRES_IN_BUILD_PARAM } from "~/shared/buildParams.js";
/**
* The `iss` claim stamped onto every token we mint. The self-hosted
* `JwtIdentityProvider` uses it to recognise its own tokens (the same way the
* Cognito provider matches on the Cognito issuer URL), so this must stay stable.
*/
export const SELF_HOSTED_ISSUER = "webi
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key