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

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5719
Author: @ic4l4s9c
Created: 11/1/2025
Status: Merged
Merged: 11/2/2025
Merged by: @Bekacru

Base: canaryHead: fix/vk-socal-provider-email-check


📝 Commits (1)

  • 2065693 fix(social-providers/vk): check for empty email after profile mapping

📊 Changes

1 file changed (+3 additions, -3 deletions)

View changed files

📝 packages/core/src/social-providers/vk.ts (+3 -3)

📄 Description

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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/5719 **Author:** [@ic4l4s9c](https://github.com/ic4l4s9c) **Created:** 11/1/2025 **Status:** ✅ Merged **Merged:** 11/2/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `fix/vk-socal-provider-email-check` --- ### 📝 Commits (1) - [`2065693`](https://github.com/better-auth/better-auth/commit/2065693286039ac1cc323d9defbd8fed4abb4ebe) fix(social-providers/vk): check for empty email after profile mapping ### 📊 Changes **1 file changed** (+3 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `packages/core/src/social-providers/vk.ts` (+3 -3) </details> ### 📄 Description 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. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-13 12:50:09 -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#6176