HonoJwt
payload
Section titled “payload”type payload = {sub: string, role: string, exp: float}
Represents the payload structure for JWT tokens.
src/HonoJwt.res:4:1
secret
Section titled “secret”type secret = string
Secret key type used for JWT signing and verification.
src/HonoJwt.res:16:1
let sign: (payload, secret) => promise<string>
Signs a JWT token with the provided payload and secret.
@param payload The data to be encoded in the JWT token
@param secret The secret key used for signing the token
@returns A promise that resolves to the signed JWT token string
src/HonoJwt.res:18:1
let sign: (payload, secret) => promise<string>
src/HonoJwt.res:26:5
jwtOptions
Section titled “jwtOptions”type jwtOptions = {secret: secret, cookie: string}
Configuration options for JWT middleware.
src/HonoJwt.res:31:1
let jwt: jwtOptions => Hono.useHandle
Creates JWT middleware for Hono framework.
@param jwtOptions Configuration object containing secret and cookie settings
@returns Hono middleware handler for JWT authentication
src/HonoJwt.res:38:1