Skip to content

HonoBearerAuth

src/HonoBearerAuth.res
type bearerAuthOptions = {
verifyToken: (string, Hono.c) => promise<bool>,
}

Configuration options for bearer token authentication middleware.

src/HonoBearerAuth.res:4:1


src/HonoBearerAuth.res
let bearerAuth: bearerAuthOptions => Hono.useHandle

Creates a bearer token authentication middleware for Hono applications.
This middleware extracts bearer tokens from the Authorization header and validates them
using the provided verification function.

@param options Configuration object containing the token verification function
@returns A Hono middleware handler that can be used with the use method

src/HonoBearerAuth.res:14:1


src/HonoBearerAuth.res
let bearerAuth: bearerAuthOptions => Hono.useHandle

Bearer token authentication middleware for Hono applications.
Validates bearer tokens from the Authorization header using a custom verification function.

@param options Configuration object with verifyToken function
@returns A middleware handler for bearer token authentication

src/HonoBearerAuth.res:32:5