Is there anyway to process custom Login? #966

Closed
opened 2026-03-13 08:12:23 -05:00 by GiteaMirror · 5 comments
Owner

Originally created by @VichetN on GitHub (Apr 3, 2025).

Is this suited for github?

  • Yes, this is suited for github

Is your feature request related to a problem? Please describe.

It would be great if BetterAuth supported custom login processing. This would allow developers to integrate their own authentication logic while still leveraging BetterAuth for user management and security.

Describe the solution you'd like

I want to do custom logic login (check user & password by myselft), but seem not to have a way to do it in BetterAuth.

Describe alternatives you've considered

Could be a callback for login process and a new function for custom Login, so we can implement our own Logic.

Additional context

No response

Originally created by @VichetN on GitHub (Apr 3, 2025). ### Is this suited for github? - [x] Yes, this is suited for github ### Is your feature request related to a problem? Please describe. It would be great if BetterAuth supported custom login processing. This would allow developers to integrate their own authentication logic while still leveraging BetterAuth for user management and security. ### Describe the solution you'd like I want to do custom logic login (check user & password by myselft), but seem not to have a way to do it in BetterAuth. ### Describe alternatives you've considered Could be a callback for login process and a new function for custom Login, so we can implement our own Logic. ### Additional context _No response_
Author
Owner

@Kinfe123 commented on GitHub (Apr 3, 2025):

since we internally use adapters to fetch from your db. it is fairly intuitive like for logout first you have to find a user based on the id and delete session and purge the session cookie as well and we do have a utils exposed for that and you can still use your orm to deal with db level stuff

@Kinfe123 commented on GitHub (Apr 3, 2025): since we internally use adapters to fetch from your db. it is fairly intuitive like for logout first you have to find a user based on the id and delete session and purge the session cookie as well and we do have a utils exposed for that and you can still use your orm to deal with db level stuff
Author
Owner

@VichetN commented on GitHub (Apr 3, 2025):

since we internally uses adapter for fetch from your db. it is fairly intuitive like for logout first you have to find a user based on the id and delete session and purge the session cookie as well and we do have a utils exposed for that and you can still use your orm to deal with db level stuff

May you share an example, if possible?

@VichetN commented on GitHub (Apr 3, 2025): > since we internally uses adapter for fetch from your db. it is fairly intuitive like for logout first you have to find a user based on the id and delete session and purge the session cookie as well and we do have a utils exposed for that and you can still use your orm to deal with db level stuff May you share an example, if possible?
Author
Owner
@Kinfe123 commented on GitHub (Apr 3, 2025): check this - https://github.com/better-auth/better-auth/blob/main/packages/better-auth/src/api/routes/sign-out.ts
Author
Owner

@VichetN commented on GitHub (Apr 3, 2025):

check this - https://github.com/better-auth/better-auth/blob/main/packages/better-auth/src/api/routes/sign-out.ts

Thanks for sharing, do you have signIn example?

@VichetN commented on GitHub (Apr 3, 2025): > check this - https://github.com/better-auth/better-auth/blob/main/packages/better-auth/src/api/routes/sign-out.ts Thanks for sharing, do you have signIn example?
Author
Owner
@Kinfe123 commented on GitHub (Apr 3, 2025): https://github.com/better-auth/better-auth/blob/main/packages/better-auth/src/api/routes/sign-in.ts
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#966