[PR #3566] [CLOSED] feat: implement getting the last used social provider #4886

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/3566
Author: @frectonz
Created: 7/23/2025
Status: Closed

Base: mainHead: feat/last-used-social


📝 Commits (2)

  • 84edde0 feat(better-auth): implement getting the last used social provider
  • f1634ec test(better-auth): update snapshot

📊 Changes

6 files changed (+68 additions, -0 deletions)

View changed files

📝 packages/better-auth/src/__snapshots__/init.test.ts.snap (+9 -0)
📝 packages/better-auth/src/api/index.ts (+2 -0)
📝 packages/better-auth/src/api/routes/callback.ts (+7 -0)
📝 packages/better-auth/src/api/routes/index.ts (+1 -0)
packages/better-auth/src/api/routes/last-social.provider.ts (+43 -0)
📝 packages/better-auth/src/cookies/index.ts (+6 -0)

📄 Description

This PR introduces a new function called lastUsedSocialProvider, which returns the last social provider used for sign-in. This function can be utilized to display an indicator to users, allowing them to choose to always use the same social provider for sign-in.


Summary by cubic

Added a new API endpoint and cookie to track and return the last social provider a user used to sign in.

  • New Features
    • Stores the last used social provider in a cookie after sign-in.
    • Provides a GET endpoint to retrieve the last used social provider for the user.

🔄 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/3566 **Author:** [@frectonz](https://github.com/frectonz) **Created:** 7/23/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/last-used-social` --- ### 📝 Commits (2) - [`84edde0`](https://github.com/better-auth/better-auth/commit/84edde013036a4739702bf2f2ba0d90c3ccfa7ce) feat(better-auth): implement getting the last used social provider - [`f1634ec`](https://github.com/better-auth/better-auth/commit/f1634ecfb482d81491db26da4fae5e703d359341) test(better-auth): update snapshot ### 📊 Changes **6 files changed** (+68 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/__snapshots__/init.test.ts.snap` (+9 -0) 📝 `packages/better-auth/src/api/index.ts` (+2 -0) 📝 `packages/better-auth/src/api/routes/callback.ts` (+7 -0) 📝 `packages/better-auth/src/api/routes/index.ts` (+1 -0) ➕ `packages/better-auth/src/api/routes/last-social.provider.ts` (+43 -0) 📝 `packages/better-auth/src/cookies/index.ts` (+6 -0) </details> ### 📄 Description This PR introduces a new function called `lastUsedSocialProvider`, which returns the last social provider used for sign-in. This function can be utilized to display an indicator to users, allowing them to choose to always use the same social provider for sign-in. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Added a new API endpoint and cookie to track and return the last social provider a user used to sign in. - **New Features** - Stores the last used social provider in a cookie after sign-in. - Provides a GET endpoint to retrieve the last used social provider for the user. <!-- 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:03: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#4886