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 Vk provider tokens causing issues with database providers #7070

Closed
wants to merge 1 commit into from

Conversation

theneuetimes
Copy link

NOTE:

  • It's a good idea to open an issue first to discuss potential changes.
  • Please make sure that you are NOT opening a PR to fix a potential security vulnerability. Instead, please follow the Security guidelines to disclose the issue to us confidentially.

☕️ Reasoning

Currently the Vk provider returns extra unnecessary data along with the tokens (more exactly vk's internal user_id and email) which renders it unusable in some cases because the data can't be stored in a database (due to the previously mentioned properties missing in the schema).

This change makes sure only the required access_token and expires_at properties are returned.

🧢 Checklist

  • Documentation
  • Tests
  • Ready to be merged

🎫 Affected issues

Please scout and link issues that might be solved by this PR.

Fixes: #3709

📌 Resources

@vercel
Copy link

vercel bot commented Mar 26, 2023

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

Name Status Preview Comments Updated
auth-docs ❌ Failed (Inspect) Mar 26, 2023 at 2:09PM (UTC)
auth-docs-nextra ❌ Failed (Inspect) Mar 26, 2023 at 2:09PM (UTC)
1 Ignored Deployment
Name Status Preview Comments Updated
next-auth-docs ⬜️ Ignored (Inspect) Mar 26, 2023 at 2:09PM (UTC)

@balazsorban44
Copy link
Member

Thanks, but the solution to this is not to restrict what the provider returns, but what the database accepts, by either extending the schema or overriding the adapter to ignore these fields.

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