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

fix: Use sub instead of id in Gitlab #11176

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tedzards509
Copy link

https://docs.gitlab.com/ee/integration/openid_connect_provider.html

The profile id is in the sub field not in the id field

☕️ Reasoning

https://docs.gitlab.com/ee/integration/openid_connect_provider.html
According to this documentation for Gitlab as an OIDC provider, "The ID of the user" is in the sub field. An id field is not provided. This change works with Gitlab Enterprise version 16.11 while editing nect-auth version 4.24.5 due to other issues that were fixed by downgrading.

🧢 Checklist

  • Documentation
  • Tests
  • Ready to be merged

🎫 Affected issues

📌 Resources

Copy link

vercel bot commented Jun 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
auth-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 16, 2024 9:45pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
next-auth-docs ⬜️ Ignored (Inspect) Visit Preview Jun 16, 2024 9:45pm

Copy link

vercel bot commented Jun 16, 2024

@tedzards509 is attempting to deploy a commit to the authjs Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions bot added providers core Refers to `@auth/core` labels Jun 16, 2024
@tedzards509
Copy link
Author

When sub.toString() is called on an undefined sub, this prevents it from reaching the error handler for a non-existing id field leading to a more cryptic error. Hence the addition of the ?

Copy link
Member

@balazsorban44 balazsorban44 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw your comment, but based on the linked documentation, sub should never be undefined and is already of type string @tedzards509. Can you verify this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Refers to `@auth/core` providers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants