© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Search
Star
Feedback
Setup for Free
Is it safe to check the user session only in middleware and not in routes in Hono? - Better Auth
BA
Better Auth
•
8mo 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
.
Recent Announcements
Similar Threads
How to use const session = c.get("session") and const user = c.get("user") in Hono when routes?
BA
Better Auth / help
11mo ago
Session is null in Nextjs 15 middleware (Express backend) only in prod
BA
Better Auth / help
6mo ago
Blocking specific routes based on user session
BA
Better Auth / help
14mo ago