[GH-ISSUE #2270] [Feature] Allow only specific email alias @xyz.com to login for organization or admin sites #9123

Closed
opened 2026-04-13 04:28:28 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @Abbhiishek on GitHub (Apr 14, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/2270

Is this suited for github?

  • Yes, this is suited for github

No

Describe the solution you'd like

For instance there is a public deployed admin dashboard where i need only specific email address to signup and signin. use case am working on is a college management system with college email address only registered students can signup and signing to the platform.

Right now am doing regex check but an inbuilt feature would be nice to have :)

Describe alternatives you've considered

na

Additional context

Authjs has a similar feature here: https://authjs.dev/guides/restricting-user-access

Originally created by @Abbhiishek on GitHub (Apr 14, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/2270 ### Is this suited for github? - [ ] Yes, this is suited for github ### Is your feature request related to a problem? Please describe. No ### Describe the solution you'd like For instance there is a public deployed admin dashboard where i need only specific email address to signup and signin. use case am working on is a college management system with college email address only registered students can signup and signing to the platform. Right now am doing regex check but an inbuilt feature would be nice to have :) ### Describe alternatives you've considered na ### Additional context Authjs has a similar feature here: https://authjs.dev/guides/restricting-user-access
GiteaMirror added the locked label 2026-04-13 04:28:28 -05:00
Author
Owner

@Nicolab commented on GitHub (Apr 14, 2025):

Hello,

It's already possible with a hook, there is an example in the doc: https://www.better-auth.com/docs/concepts/hooks#example-enforce-email-domain-restriction

<!-- gh-comment-id:2800617539 --> @Nicolab commented on GitHub (Apr 14, 2025): Hello, It's already possible with a hook, there is an example in the doc: https://www.better-auth.com/docs/concepts/hooks#example-enforce-email-domain-restriction
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#9123