Skip to content
Myr

fix: use `atob` for basic auth (#84)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

* fix: use `atob` for basic auth * Update readme * fallback

authored by Yusuke Wada · committed by GitHub · parent 0fe95bc · Browse files · 4 files+40 added−28 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

4 files+40 added−28 removed

  • other:+40 added−28 removed

4 files+40 added−28 removed

modified:examples/basic/index.js+3 added-10 removed
modified:examples/basic/package.json+5 added-2 removed
modified:src/middleware/basic-auth/basic-auth.ts+6 added-16 removed
added:src/middleware/basic-auth/README.md+26 added
1# Basic Auth Middleware23## Usage45index.js:67```js8import { Hono } from 'hono'9import { basicAuth } from 'hono/basic-auth'1011const app = new Hono()1213app.use(14 '/auth/*',15 basicAuth({16 username: 'hono',17 password: 'acoolproject',18 })19)2021app.get('/auth/page', (c) => {22 return c.text('You are authorized')23})2425app.fire()26```