Better auth does not pre-fill social info like image if row has been added externally #1807

Closed
opened 2026-03-13 09:04:55 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @MariuzM on GitHub (Aug 29, 2025).

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

I have a case where sometime the user table will insert user email and code (extra column) but once user signs with social login like gogole it does not pre-fill the rest columns like name and images from google api.

Current vs. Expected behavior

I wish if i added user externally that when signing in with google to pre-fill the rest information like name and image

What version of Better Auth are you using?

1.3.7

System info

System:
    OS: macOS 15.6.1
    CPU: (10) arm64 Apple M1 Max
    Memory: 3.23 GB / 64.00 GB
    Shell: 5.9 - /bin/zsh
  Browsers:
    Brave Browser: 139.1.81.136
    Chrome: 138.0.7204.49
    Safari: 18.6

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

Backend

Auth config (if applicable)

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

Additional context

No response

Originally created by @MariuzM on GitHub (Aug 29, 2025). ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce I have a case where sometime the `user` table will insert user `email` and `code` (extra column) but once user signs with social login like gogole it does not pre-fill the rest columns like `name` and `images` from google api. ### Current vs. Expected behavior I wish if i added user externally that when signing in with google to pre-fill the rest information like `name` and `image` ### What version of Better Auth are you using? 1.3.7 ### System info ```bash System: OS: macOS 15.6.1 CPU: (10) arm64 Apple M1 Max Memory: 3.23 GB / 64.00 GB Shell: 5.9 - /bin/zsh Browsers: Brave Browser: 139.1.81.136 Chrome: 138.0.7204.49 Safari: 18.6 ``` ### Which area(s) are affected? (Select all that apply) Backend ### Auth config (if applicable) ```typescript import { betterAuth } from "better-auth" export const auth = betterAuth({ emailAndPassword: { enabled: true }, }); ``` ### Additional context _No response_
Author
Owner

@dosubot[bot] commented on GitHub (Aug 29, 2025):

This is a valid issue for GitHub. Better Auth does not automatically update missing user info (like name or image) from social providers when a user row is added externally and then signs in with Google. The mapProfileToUser function only runs during initial user creation, not on subsequent social logins or account linking, so existing user records aren't enriched with new social profile data by default.

A recommended workaround is to use database hooks to update user or account data after social login events. For example, you can add a hook on account update to fetch and save profile information such as name and image from the provider API, and then patch your user record accordingly. This pattern is documented for saving usernames and can be adapted for other fields like name and image. See this example.

There is also an overrideUserInfo option in the OAuth provider config, but its usage for updating existing user records is not clearly documented or implemented for this scenario in the codebase. For now, database hooks are the most flexible solution for keeping user info up to date after social sign-in.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

@dosubot[bot] commented on GitHub (Aug 29, 2025): <!-- Answer --> This is a valid issue for GitHub. Better Auth does not automatically update missing user info (like name or image) from social providers when a user row is added externally and then signs in with Google. The mapProfileToUser function only runs during initial user creation, not on subsequent social logins or account linking, so existing user records aren't enriched with new social profile data by default. A recommended workaround is to use database hooks to update user or account data after social login events. For example, you can add a hook on account update to fetch and save profile information such as name and image from the provider API, and then patch your user record accordingly. This pattern is documented for saving usernames and can be adapted for other fields like name and image. See [this example](https://github.com/better-auth/better-auth/issues/2713). There is also an overrideUserInfo option in the OAuth provider config, but its usage for updating existing user records is not clearly documented or implemented for this scenario in the codebase. For now, database hooks are the most flexible solution for keeping user info up to date after social sign-in. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/8a7cd0db-fae4-4c44-8df8-612df8f08bbb?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/8a7cd0db-fae4-4c44-8df8-612df8f08bbb?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/8a7cd0db-fae4-4c44-8df8-612df8f08bbb?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/8a7cd0db-fae4-4c44-8df8-612df8f08bbb?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/8a7cd0db-fae4-4c44-8df8-612df8f08bbb?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/8a7cd0db-fae4-4c44-8df8-612df8f08bbb?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/8a7cd0db-fae4-4c44-8df8-612df8f08bbb?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/cdda13d9-dd27-4d31-b09a-5d8bec92de21/ask?utm_source=github)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/better-auth/better-auth/issues/4304)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#1807