[PR #5719] fix(vk): check for empty email after user profile mapping #14423

Closed
opened 2026-04-13 09:28:03 -05:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/better-auth/better-auth/pull/5719

State: closed
Merged: Yes


Changes:

  • Moves the email validation check to after the mapProfileToUser function call (instead of before)
  • Updates the validation to accept an email from either profile.user.email or userMap.email

Impact:

This allows the mapProfileToUser callback to provide an email address even when the VK profile doesn't include one.


Summary by cubic

Validate email after mapProfileToUser in the VK provider so we can use an email from either the VK profile or the mapping. Prevents returning null when VK doesn’t include an email but the mapping provides one.

Written for commit 2065693286. Summary will update automatically on new commits.

**Original Pull Request:** https://github.com/better-auth/better-auth/pull/5719 **State:** closed **Merged:** Yes --- Changes: - Moves the email validation check to after the `mapProfileToUser` function call (instead of before) - Updates the validation to accept an email from either `profile.user.email` or `userMap.email` Impact: This allows the `mapProfileToUser` callback to provide an email address even when the VK profile doesn't include one. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Validate email after mapProfileToUser in the VK provider so we can use an email from either the VK profile or the mapping. Prevents returning null when VK doesn’t include an email but the mapping provides one. <sup>Written for commit 2065693286039ac1cc323d9defbd8fed4abb4ebe. Summary will update automatically on new commits.</sup> <!-- End of auto-generated description by cubic. -->
GiteaMirror added the pull-request label 2026-04-13 09:28:03 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#14423