Support for stateless authentication without a database #2045

Closed
opened 2026-03-13 09:22:53 -05:00 by GiteaMirror · 11 comments
Owner

Originally created by @YukiOnishi1129 on GitHub (Sep 30, 2025).

Is this suited for github?

  • Yes, this is suited for github

Currently, according to the documentation (https://www.better-auth.com/docs/concepts/database),
Better Auth requires database-backed session management.

In my project, authentication checks are handled by a micro-service,
and the database is only accessible from that micro-service.
Next.js should not access the database directly.

If Better Auth requires direct DB access from Next.js, we cannot adopt it.

Describe the solution you'd like

I would like to see support for a stateless authentication approach
(similar to Auth.js with JWT/session tokens),
where Next.js does not need direct access to a database.

Alternatively, I would like to know if it is possible to customize the
core schema (https://www.better-auth.com/docs/concepts/database#core-schema)
to integrate with an existing system, without replacing our entire DB structure.

Describe alternatives you've considered

  • Using Better Auth with the default DB schema (but this would require major schema changes in our system, which is difficult).
  • Falling back to Auth.js, which allows stateless JWT-based authentication, but we would prefer to adopt Better Auth if possible.

Additional context

Our architecture is microservice-based, with Go handling user authentication
and issuing tokens. We would like to adopt Better Auth for Next.js integration,
but only if it can work without requiring direct DB access or drastic schema changes.

Originally created by @YukiOnishi1129 on GitHub (Sep 30, 2025). ### Is this suited for github? - [ ] Yes, this is suited for github ### Is your feature request related to a problem? Please describe. Currently, according to the documentation (https://www.better-auth.com/docs/concepts/database), Better Auth requires database-backed session management. In my project, authentication checks are handled by a micro-service, and the database is only accessible from that micro-service. Next.js should not access the database directly. If Better Auth requires direct DB access from Next.js, we cannot adopt it. ### Describe the solution you'd like I would like to see support for a stateless authentication approach (similar to Auth.js with JWT/session tokens), where Next.js does not need direct access to a database. Alternatively, I would like to know if it is possible to customize the core schema (https://www.better-auth.com/docs/concepts/database#core-schema) to integrate with an existing system, without replacing our entire DB structure. ### Describe alternatives you've considered - Using Better Auth with the default DB schema (but this would require major schema changes in our system, which is difficult). - Falling back to Auth.js, which allows stateless JWT-based authentication, but we would prefer to adopt Better Auth if possible. ### Additional context Our architecture is microservice-based, with Go handling user authentication and issuing tokens. We would like to adopt Better Auth for Next.js integration, but only if it can work without requiring direct DB access or drastic schema changes.
GiteaMirror added the nextjsenhancement labels 2026-03-13 09:22:53 -05:00
Author
Owner

@soulbalz commented on GitHub (Sep 30, 2025):

Since AuthJS is part of Better Auth, I can't wait to see Better Auth support this ASAP, because we also have a backend that manages authentication logic, and for security purposes in my company, they said that NextJS or any frontend can't directly connect to the database

@soulbalz commented on GitHub (Sep 30, 2025): Since AuthJS is part of Better Auth, I can't wait to see Better Auth support this ASAP, because we also have a backend that manages authentication logic, and for security purposes in my company, they said that NextJS or any frontend can't directly connect to the database
Author
Owner

@himself65 commented on GitHub (Sep 30, 2025):

Hi, we are prioritizing this feature. I think it take time to re-design the structure, but we will do that

@himself65 commented on GitHub (Sep 30, 2025): Hi, we are prioritizing this feature. I think it take time to re-design the structure, but we will do that
Author
Owner

@YukiOnishi1129 commented on GitHub (Oct 1, 2025):

@himself65
Thank you for your reply!
I'm really looking forward to this feature, and I hope it can be available as soon as possible.

@YukiOnishi1129 commented on GitHub (Oct 1, 2025): @himself65 Thank you for your reply! I'm really looking forward to this feature, and I hope it can be available as soon as possible.
Author
Owner

@soulbalz commented on GitHub (Oct 1, 2025):

@YukiOnishi1129 Hi, I think you should keep this issue open, so that we can track the progress of it

@soulbalz commented on GitHub (Oct 1, 2025): @YukiOnishi1129 Hi, I think you should keep this issue open, so that we can track the progress of it
Author
Owner

@YukiOnishi1129 commented on GitHub (Oct 1, 2025):

@soulbalz
OK! I'll keep this issue open.

@YukiOnishi1129 commented on GitHub (Oct 1, 2025): @soulbalz OK! I'll keep this issue open.
Author
Owner

@YukiOnishi1129 commented on GitHub (Oct 1, 2025):

@himself65
Hi, I’m currently using NextAuth v4.
Do you think it’s better to stay on v4 instead of moving to the v5 beta?

From what I understand, going forward the Better Auth team will mainly focus on improving Better Auth itself, and won’t put much effort into improving NextAuth v5. Is that correct?

If so, my plan is to keep using v4 for now, and then migrate to Better Auth once stateless authentication is supported.
Will there be any migration guide or recommended way to move from NextAuth to Better Auth when the time comes?

Thanks!

@YukiOnishi1129 commented on GitHub (Oct 1, 2025): @himself65 Hi, I’m currently using NextAuth v4. Do you think it’s better to stay on v4 instead of moving to the v5 beta? From what I understand, going forward the Better Auth team will mainly focus on improving Better Auth itself, and won’t put much effort into improving NextAuth v5. Is that correct? If so, my plan is to keep using v4 for now, and then migrate to Better Auth once stateless authentication is supported. Will there be any migration guide or recommended way to move from NextAuth to Better Auth when the time comes? Thanks!
Author
Owner

@cnbrown04 commented on GitHub (Oct 9, 2025):

@himself65 Hi, I’m currently using NextAuth v4. Do you think it’s better to stay on v4 instead of moving to the v5 beta?

From what I understand, going forward the Better Auth team will mainly focus on improving Better Auth itself, and won’t put much effort into improving NextAuth v5. Is that correct?

If so, my plan is to keep using v4 for now, and then migrate to Better Auth once stateless authentication is supported. Will there be any migration guide or recommended way to move from NextAuth to Better Auth when the time comes?

Thanks!

You should probably stay on NextAuth for now until the update, I'm migrating my services from Better Auth -> NextAuth for the time being until stateless is supported. There's already a migration guide in the documentation so im sure it'll be included in there somewhere.

@cnbrown04 commented on GitHub (Oct 9, 2025): > [@himself65](https://github.com/himself65) Hi, I’m currently using NextAuth v4. Do you think it’s better to stay on v4 instead of moving to the v5 beta? > > From what I understand, going forward the Better Auth team will mainly focus on improving Better Auth itself, and won’t put much effort into improving NextAuth v5. Is that correct? > > If so, my plan is to keep using v4 for now, and then migrate to Better Auth once stateless authentication is supported. Will there be any migration guide or recommended way to move from NextAuth to Better Auth when the time comes? > > Thanks! You should probably stay on NextAuth for now until the update, I'm migrating my services from Better Auth -> NextAuth for the time being until stateless is supported. There's already a migration guide in the documentation so im sure it'll be included in there somewhere.
Author
Owner

@AhmedBaset commented on GitHub (Oct 9, 2025):

This issue is a duplicate of https://github.com/better-auth/better-auth/issues/2202

@AhmedBaset commented on GitHub (Oct 9, 2025): This issue is a duplicate of https://github.com/better-auth/better-auth/issues/2202
Author
Owner

@codeagencybe commented on GitHub (Oct 28, 2025):

Is there are update/feedback/ETA on this one yet? I'm also stuck on this and I don't really want to change back to Authjs.

@codeagencybe commented on GitHub (Oct 28, 2025): Is there are update/feedback/ETA on this one yet? I'm also stuck on this and I don't really want to change back to Authjs.
Author
Owner

@soulbalz commented on GitHub (Oct 29, 2025):

Is there are update/feedback/ETA on this one yet? I'm also stuck on this and I don't really want to change back to Authjs.

They will release this feature in version 1.4, and I can already see that they have been working on stateless sessions and have already released v1.4.0-beta.15

@soulbalz commented on GitHub (Oct 29, 2025): > Is there are update/feedback/ETA on this one yet? I'm also stuck on this and I don't really want to change back to Authjs. They will release this feature in version 1.4, and I can already see that they have been working on stateless sessions and have already released [v1.4.0-beta.15](https://github.com/better-auth/better-auth/releases/tag/v1.4.0-beta.15)
Author
Owner

@realtebo commented on GitHub (Nov 13, 2025):

We are using latest beta and can confirm stateless is working without problems.
Add a cent: it's working on aws amplify, that is something like a battle arena for js

Whern 1.4 will be released we will switch to stable.
actually we're in prod with beta versione due to hurry up to kick off the train the next-auth

@realtebo commented on GitHub (Nov 13, 2025): We are using latest beta and can confirm stateless is working without problems. Add a cent: it's working on aws amplify, that is something like a battle arena for js Whern 1.4 will be released we will switch to stable. actually we're in prod with beta versione due to hurry up to kick off the train the next-auth
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#2045