Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: GitHub connection does not fetch email-address #5809

Open
1 of 4 tasks
stephanvane opened this issue Apr 29, 2024 · 1 comment
Open
1 of 4 tasks

bug: GitHub connection does not fetch email-address #5809

stephanvane opened this issue Apr 29, 2024 · 1 comment
Assignees
Labels
feature-request Something cool or not cool

Comments

@stephanvane
Copy link

Describe the bug

When using the GitHub connector, a new account will be created without an email address (unless the user has a public email address on their GitHub profile)

Expected behavior

I would expect Logto, to fetch the email-address from GitHub, in addition to the avatar / fulll-name etc.

This van be solved by doing 2 calls. One call to https://api.github.com/user to fetch basic information. and one extra call to https://api.github.com/user/emails fetch the primary email-address.

This call returns something like this:

[
  {
    "email": "***@***.***",
    "primary": true,
    "verified": true,
    "visibility": "public"
  }
]

Next-auth uses the same approach, please look at this code for inspiration.

Please let me know if I can help out. I'm a little limited in time, but I think this problem is breaking quite some integrations.

How to reproduce?

  1. Disable public email in GitHub settings (screenshot 1)
  2. Try to login, using the GitHub connection
  3. View the new user in the admin-dashboard. The Name/avatar etc. have been filled in, but the email-field is empty.

Context

  • Logto Cloud
  • Self-hosted, Logto version =docker.io/svhd/logto@sha256:9c1757cced89be7ba8052c289728a33e742ae7e069e8da8ae2e015a400b7afba
  • Container (Docker image)
  • Raw Node.js

Screenshots

1: Screenshot 2024-04-29 at 14 59 06

@stephanvane stephanvane added the bug Something isn't working label Apr 29, 2024
@wangsijie wangsijie self-assigned this Apr 30, 2024
@wangsijie wangsijie added feature-request Something cool or not cool and removed bug Something isn't working labels Apr 30, 2024
@darcyYe
Copy link
Contributor

darcyYe commented May 6, 2024

We have an PR #5737 resolving the case you mentioned in this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Something cool or not cool
Development

No branches or pull requests

3 participants