Nextjs Frontend + Express Backend (Better-auth @express), Better-not triggering custom adapter

Hi. I'm using Nextjs frontend and express backend for a project. The better-auth is implemented at expressjs. The backend is a microservice comprised of many different service. the auth service provides the jwt token which the api-gateway verifies to get the iss (issuer) and acl groups involved and only grants access to certain part of requests made by the frontend. currently I'm facing issue with implementing better-auth at both nextjs and express. I switched to better-auth to get the flexibility to add plugin type auths to my app. Here's the problem 1. The better-auth client (in Nextjs frontend) is configured to hit the express auth-service (backend running at som port) 2. the better-auth client is configured (baseURL) to hit the
backendurl:port/auth
backendurl:port/auth
. Here's a snapshot of the request hitting the backend. 3. The backend api-gateway receives the request and routes to the auth-service successfully. 4. I get a response of
{"ok": "true"}
{"ok": "true"}
when I hit the
backend:port/auth/ok
backend:port/auth/ok
. 5. I now sign up using a form in which the form call the signup.email method (described in the screenshot). 6. I don't see the better auth triggered in the backend. for the info, I have implemented a custom adapter to work for my use-case. implementing all the create, update, findOne, findMany and all methods. Second problem I want the jwt to include the roles and I want to use HS256 algorithm to sign the keys. Does the better-auth support that algorithm? also I didn't get the correct jwt tokens when I hit
/api/auth/token
/api/auth/token
when I have setup the better-auth jwt plugin when I tried to keep the auth logic in the frontend. Please solve this issue.
No description
No description
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?