Hono + Bun gives a 404 on /api/auth/ok endpoint
Hey, I'm trying to setup better-auth on a hono server like this, but when I call the /api/auth/ok endpoint I got a 404.
In fact I'm also using a
app.route()
in my entryfile.
Working version
Non working version
It's really strange that this bug happen when I have a new endpoint declarated
Has anyone had this problem before, or can anyone help me?
Wishing you a good day 😉5 Replies
Problem solved the
/api/auth/**
handler is not well written, change it to /api/auth/*
(PR that solve the issue in better-auth docs https://github.com/better-auth/better-auth/pull/1317)Does re-ordering them work?
Yes, I solved the issue by reordering them, checkout the code changes in this PR to fix the issue https://github.com/better-auth/better-auth/pull/1317
GitHub
docs: wrong pattern in hono integration code by MatteoGauthier · Pu...
Caused by c26285b
The pattern should be * instead of ** since it's not a supported syntax
It is causing strange issue then in the Hono server handlers
Working version
const app = new Hono()...
Actually ** seems to work for me
But I am only using hono for auth and attaching a trpc instance to it as well
Very strange ...