Cors Error on Elysia with Node Adapter
i always got cors error only for better-auth api on Elysia, here is my backend code (Elysia):
my github repo link: https://github.com/mamlzy/cms-hono.git (on
elysia
branch)GitHub
GitHub - mamlzy/cms-hono
Contribute to mamlzy/cms-hono development by creating an account on GitHub.

13 Replies
server
auth.ts
client auth.ts

Check that your NEXT PUBLIC WEB BASE URL is in fact http://localhost:3000
even i hardcoded it, the cors keep yelling, i don't know why
i'll try to double check it again, thanks for the suggestion @Laktos
hey @Imam have you achieved to resolve your problem ?
are you still facing this issue on the latest version of elysia + node adpater & better-auth? since facing this issue, i don't use elysia again
i'm not using that stack, i'm using a front in next.js and a back in express.js, i have the better-auth client in my front and the better-auth on my api
i think using next.js with express would work perfectly fine
i was using hono and just works
but you should concern about the url stuff, the cors would not giving any errors
next.js + hono (seperate repo)
mmh, i have no idea what i do wrong.. and have the exact same error as your last screen
how about the
trustedOrigins
?
u could check the docs about it
better-auth docsi have it in my back with my front url
can you just hard code the url? i mean do not use env variables just for testing
it is actually hardcoed
oh i just found my problem, it was in my order between cors config and endoint, i'm sorry 😉 thank you ^^