Search
Star
Feedback
Setup for Free
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Is it safe to check the user session only in middleware and not in routes in Hono? - Better Auth
BA
Better Auth
•
7mo ago
•
3 replies
maderin
Is it safe to check the user session only in middleware and not in routes in Hono?
This is not recommended in Fullstack frameworks like SvelteKit and Nextjs
. But with Hono
, can we rely on this
?
I mean checking the session in a global middleware
, and just returning 401 there if cannot get it
.
.
.
I believe yes
, but I just want to double check
, and also maybe some experienced person can update the documentation
https://www.better-auth.com/docs/integrations/hono
Hono Integration | Better Auth
Integrate Better Auth with Hono
.
Better Auth
Join
9,988
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Recent Announcements
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
How to use const session = c.get("session") and const user = c.get("user") in Hono when routes?
BA
Better Auth / help
10mo ago
Session is null in Nextjs 15 middleware (Express backend) only in prod
BA
Better Auth / help
5mo ago
Blocking specific routes based on user session
BA
Better Auth / help
12mo ago