mmcc avatar
honoBasicAuth
@mmcc
Script
Val Town Basic Auth Middleware for Hono pomdtr/basicAuth but for Hono. Usage Register the middleware and you're good to go. import { basicAuth } from "https://esm.town/v/mmcc/honoBasicAuth"; app.use('/authed/*', basicAuth()); app.get('/auth/profile', c => { }); To authenticate, paste an api token in the password prompt.
stevekrouse avatar
basicAuth
@stevekrouse
Script
Val Town Basic Auth Add basic auth on top of any http val Usage Wrap your HTTP handler in the basicAuth middleware. import { basicAuth } from "https://esm.town/v/pomdtr/basicAuth"; function handler(req: Request) { return new Response("You are authenticated!"); } export default basicAuth(handler); To authenticate, paste an api token in the password prompt.
1
Next
v66
June 23, 2024