[GH-ISSUE #3078] Social sign ins bypasses required fields in user #18096

Closed
opened 2026-04-15 16:27:39 -05:00 by GiteaMirror · 7 comments
Owner

Originally created by @Frost7994 on GitHub (Jun 18, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/3078

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

I've extended the user object and schema as per docs to include a username and role field. Everything works as expected. I now want to add oauth to my project. The problem is signing in with oauth means a user will be created but won't have the username or role fields which are required throughout my application. How can I avoid this? Thanks in advance

Current vs. Expected behavior

Checked the docs with no answer

What version of Better Auth are you using?

1.2.9

Provide environment information

OS: Windows 10
Browser: Google Chrome

Which area(s) are affected? (Select all that apply)

Client

Auth config (if applicable)

import { betterAuth } from "better-auth"
export const auth = betterAuth({
  emailAndPassword: {  
    enabled: true
  },
});

Additional context

No response

Originally created by @Frost7994 on GitHub (Jun 18, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/3078 ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce I've extended the user object and schema as per docs to include a username and role field. Everything works as expected. I now want to add oauth to my project. The problem is signing in with oauth means a user will be created but won't have the username or role fields which are required throughout my application. How can I avoid this? Thanks in advance ### Current vs. Expected behavior Checked the docs with no answer ### What version of Better Auth are you using? 1.2.9 ### Provide environment information ```bash OS: Windows 10 Browser: Google Chrome ``` ### Which area(s) are affected? (Select all that apply) Client ### Auth config (if applicable) ```typescript import { betterAuth } from "better-auth" export const auth = betterAuth({ emailAndPassword: { enabled: true }, }); ``` ### Additional context _No response_
GiteaMirror added the locked label 2026-04-15 16:27:39 -05:00
Author
Owner

@H7ioo commented on GitHub (Jun 28, 2025):

Did you find a solution?
I have the same issue now with username plugin and OAuth. Before triggering OAuth I made a small dialog to let the user accept the privacy-policy & terms-of-service and setting a username but I'm now wondering, how can I access those values inside databaseHooks

<!-- gh-comment-id:3015496003 --> @H7ioo commented on GitHub (Jun 28, 2025): Did you find a solution? I have the same issue now with username plugin and OAuth. Before triggering OAuth I made a small dialog to let the user accept the privacy-policy & terms-of-service and setting a username but I'm now wondering, how can I access those values inside databaseHooks
Author
Owner

@dosubot[bot] commented on GitHub (Sep 27, 2025):

Hi, @Frost7994. I'm Dosu, and I'm helping the better-auth team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You reported that Better Auth v1.2.9 bypasses required custom fields like username and role during OAuth sign-in, causing incomplete user data.
  • Another user, H7ioo, shared a similar experience and a workaround involving a pre-OAuth dialog for username and policy acceptance.
  • H7ioo also asked for guidance on accessing these values in databaseHooks.
  • No official solution or maintainer response has been provided so far.

Next Steps:

  • Please let me know if this issue is still relevant with the latest version of better-auth by commenting here.
  • If I don’t hear back within 7 days, I will automatically close this issue.

Thanks for your understanding and contribution!

<!-- gh-comment-id:3341882163 --> @dosubot[bot] commented on GitHub (Sep 27, 2025): Hi, @Frost7994. I'm [Dosu](https://dosu.dev), and I'm helping the better-auth team manage their backlog and am marking this issue as stale. **Issue Summary:** - You reported that Better Auth v1.2.9 bypasses required custom fields like username and role during OAuth sign-in, causing incomplete user data. - Another user, H7ioo, shared a similar experience and a workaround involving a pre-OAuth dialog for username and policy acceptance. - H7ioo also asked for guidance on accessing these values in databaseHooks. - No official solution or maintainer response has been provided so far. **Next Steps:** - Please let me know if this issue is still relevant with the latest version of better-auth by commenting here. - If I don’t hear back within 7 days, I will automatically close this issue. Thanks for your understanding and contribution!
Author
Owner

@ikemHood commented on GitHub (Oct 4, 2025):

This is a valid issue

<!-- gh-comment-id:3368457258 --> @ikemHood commented on GitHub (Oct 4, 2025): This is a valid issue
Author
Owner

@dosubot[bot] commented on GitHub (Jan 8, 2026):

Hi, @Frost7994. I'm Dosu, and I'm helping the better-auth team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You reported that Better Auth v1.2.9 bypasses required custom fields like username and role during OAuth sign-in, causing incomplete user data.
  • Another user shared a workaround involving a pre-OAuth dialog to collect username and policy acceptance but sought advice on accessing these values in databaseHooks.
  • The issue remains unresolved with no official fix or guidance provided yet.
  • A maintainer marked the issue as stale due to lack of recent activity.
  • Another user confirmed the issue is still valid.

Next Steps:

  • Please let me know if this issue is still relevant with the latest version of better-auth by commenting here to keep the discussion open.
  • Otherwise, this issue will be automatically closed in 7 days.

Thank you for your understanding and contribution!

<!-- gh-comment-id:3724600370 --> @dosubot[bot] commented on GitHub (Jan 8, 2026): Hi, @Frost7994. I'm [Dosu](https://dosu.dev), and I'm helping the better-auth team manage their backlog and am marking this issue as stale. **Issue Summary:** - You reported that Better Auth v1.2.9 bypasses required custom fields like username and role during OAuth sign-in, causing incomplete user data. - Another user shared a workaround involving a pre-OAuth dialog to collect username and policy acceptance but sought advice on accessing these values in databaseHooks. - The issue remains unresolved with no official fix or guidance provided yet. - A maintainer marked the issue as stale due to lack of recent activity. - Another user confirmed the issue is still valid. **Next Steps:** - Please let me know if this issue is still relevant with the latest version of better-auth by commenting here to keep the discussion open. - Otherwise, this issue will be automatically closed in 7 days. Thank you for your understanding and contribution!
Author
Owner

@Paola3stefania commented on GitHub (Jan 9, 2026):

hi @Frost7994 still having this issue with latest version?

<!-- gh-comment-id:3730703462 --> @Paola3stefania commented on GitHub (Jan 9, 2026): hi @Frost7994 still having this issue with latest version?
Author
Owner

@ping-maxwell commented on GitHub (Mar 25, 2026):

closing as stale / no response.

<!-- gh-comment-id:4128539107 --> @ping-maxwell commented on GitHub (Mar 25, 2026): closing as stale / no response.
Author
Owner

@github-actions[bot] commented on GitHub (Apr 2, 2026):

This issue has been locked as it was closed more than 7 days ago. If you're experiencing a similar problem or you have additional context, please open a new issue and reference this one.

<!-- gh-comment-id:4173717892 --> @github-actions[bot] commented on GitHub (Apr 2, 2026): This issue has been locked as it was closed more than 7 days ago. If you're experiencing a similar problem or you have additional context, please open a new issue and reference this one.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#18096