import { Hono } from 'hono'
import { basicAuth } from 'hono/basic-auth'
export type Env = {
PASS: string
}
const app = new Hono<{ Bindings: Env }>()
app.post(
'/test',
basicAuth({
verifyUser: (username, password, c) => {
return (username === 'admin' && password === c.env /* <-- does not autocomplete, Context<any, any>? */)
}
}),
async (c) => {
return c.body('OK')
}
)
import { Hono } from 'hono'
import { basicAuth } from 'hono/basic-auth'
export type Env = {
PASS: string
}
const app = new Hono<{ Bindings: Env }>()
app.post(
'/test',
basicAuth({
verifyUser: (username, password, c) => {
return (username === 'admin' && password === c.env /* <-- does not autocomplete, Context<any, any>? */)
}
}),
async (c) => {
return c.body('OK')
}
)