/Wiki/sources/honojs__hono/2026/https-hono-dev-llms-full-txt-onauthsuccess-c-con-f0f9bc15689b-onauthsuccess-c-context-username-string-void-promise-s0295-c0000.md

onAuthSuccess: `(c: Context, username: string) => void | Promise ` -...

onAuthSuccess: (c: Context, username: string) = void | Promise Source evidence: /Sources/raw/honojs hono/honojs hono.md Canonical citation: https://hono.dev/...

onAuthSuccess: (c: Context, username: string) => void | Promise

Source evidence: /Sources/raw/honojshono/honojshono.md Canonical citation: https://hono.dev/llms-full.txt#onauthsuccess-c-context-username-string-void-promise

Summary

A callback function invoked after successful authentication. This allows you to set context variables or perform side effects without re-parsing the Authorization header. ```ts app.use( '/auth/*', basicAuth({ username: 'hono', password:...

Content

A callback function invoked after successful authentication. This allows you to set context variables or perform side effects without re-parsing the Authorization header.

app.use(
  '/auth/*',
  basicAuth({
    username: 'hono',
    password: 'acoolproject',
    onAuthSuccess: (c, username) => {
      c.set('username', username)
    },
  })
)

app.get('/auth/page', (c) => {
  const username = c.get('username')
  return c.text(`Hello, ${username}!`)
})
Kinic Wiki
Loading knowledge node
Details

Identity

database
db_23dhmsxlhukv
database_id
db_23dhmsxlhukv
path
/Wiki/sources/honojs__hono/2026/https-hono-dev-llms-full-txt-onauthsuccess-c-con-f0f9bc15689b-onauthsuccess-c-context-username-string-void-promise-s0295-c0000.md
kind
directory
role
markdown_note
children
0

Metadata

created_at
virtual
updated_at
virtual
etag
virtual
metadata_json
{}

Lint Hints

No lightweight warnings.

Outgoing Links

No outgoing links indexed.

Incoming Links

Select a file node to inspect backlinks.

Raw Source

No raw source path inferred.