[PR #6016] [MERGED] fix(last-login-method): LastLoginMethod cookie is not set when using a generic oauth provider #6385

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/6016
Author: @nbifrye
Created: 11/16/2025
Status: Merged
Merged: 11/16/2025
Merged by: @Bekacru

Base: canaryHead: fix/last-login-method-generic-oauth


📝 Commits (1)

  • 9854531 fix(last-login-method): fix genericOAuth

📊 Changes

2 files changed (+91 additions, -2 deletions)

View changed files

📝 packages/better-auth/src/plugins/last-login-method/index.ts (+4 -2)
📝 packages/better-auth/src/plugins/last-login-method/last-login-method.test.ts (+87 -0)

📄 Description

Fixes https://github.com/better-auth/better-auth/issues/5970


Summary by cubic

Fixes last login method resolution for generic OAuth by correctly handling /oauth2/callback/:providerId so the cookie and user.lastLoginMethod are set.

  • Bug Fixes
    • Added support for providerId in /oauth2/callback paths and resolver fallback.
    • Added tests covering generic OAuth flow to verify cookie and session values.

Written for commit 985453176e. 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/6016 **Author:** [@nbifrye](https://github.com/nbifrye) **Created:** 11/16/2025 **Status:** ✅ Merged **Merged:** 11/16/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `fix/last-login-method-generic-oauth` --- ### 📝 Commits (1) - [`9854531`](https://github.com/better-auth/better-auth/commit/985453176e346ef569829b3286ec015b9360d498) fix(last-login-method): fix genericOAuth ### 📊 Changes **2 files changed** (+91 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/last-login-method/index.ts` (+4 -2) 📝 `packages/better-auth/src/plugins/last-login-method/last-login-method.test.ts` (+87 -0) </details> ### 📄 Description Fixes https://github.com/better-auth/better-auth/issues/5970 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixes last login method resolution for generic OAuth by correctly handling /oauth2/callback/:providerId so the cookie and user.lastLoginMethod are set. - **Bug Fixes** - Added support for providerId in /oauth2/callback paths and resolver fallback. - Added tests covering generic OAuth flow to verify cookie and session values. <sup>Written for commit 985453176e346ef569829b3286ec015b9360d498. 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:57: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#6385