/Wiki/sources/honojs__hono/2026/https-raw-githubusercontent-com-honojs-hono-main-1abd53ca1105-basic-auth-middleware-and-bearer-auth-middleware-s0017-c0000.md
Basic Auth Middleware and Bearer Auth Middleware - hono-docs
Basic Auth Middleware and Bearer Auth Middleware Source evidence: /Sources/raw/honojs hono/honojs hono.md Canonical citation: https://raw.githubusercontent.c...
Basic Auth Middleware and Bearer Auth Middleware
Source evidence: /Sources/raw/honojshono/honojshono.md Canonical citation: https://raw.githubusercontent.com/honojs/hono/main/docs/MIGRATION.md#basic-auth-middleware-and-bearer-auth-middleware
Summary
If you are using Basic Auth and Bearer Auth in your Handler (nested), change as follows: ```ts app.use('/auth/*', async (c, next) => { const auth = basicAuth({ username: c.env.USERNAME, password: c.env.PASSWORD }) return auth(c, next) //...
Content
If you are using Basic Auth and Bearer Auth in your Handler (nested), change as follows:
app.use('/auth/*', async (c, next) => {
const auth = basicAuth({ username: c.env.USERNAME, password: c.env.PASSWORD })
return auth(c, next) // Older: `await auth(c, next)`
})