authorization #2452
ltorresu82
started this conversation in
General
authorization
#2452
Replies: 1 comment 3 replies
-
Yes you can protect routes by using middleware. Basic, Bearer, JWT middleware is built in but for casbin you may have to create your own. https://hono.dev/middleware/builtin/basic-auth import { Hono } from 'hono'
import { basicAuth } from 'hono/basic-auth'
const app = new Hono()
app.get(
'/secure',
basicAuth({ 'admin', 'axkdu2w23' }),
(c) => {
return c.text('You are authorized')
}),
) |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is it possible to protect routes using for example casbin?
Beta Was this translation helpful? Give feedback.
All reactions