[PR #5753] feat(last-login-method): beforeStoreCookie option for GDPR compliance #23102

Open
opened 2026-04-15 21:29:21 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5753
Author: @ping-maxwell
Created: 11/4/2025
Status: 🔄 Open

Base: mainHead: feat/last-login-method-beforeStoreCookie


📝 Commits (1)

  • 80dd936 feat(last-login-method): beforeStoreCookie option for GDPR compliance

📊 Changes

3 files changed (+948 additions, -0 deletions)

View changed files

📝 docs/content/docs/plugins/last-login-method.mdx (+73 -0)
📝 packages/better-auth/src/plugins/last-login-method/index.ts (+36 -0)
📝 packages/better-auth/src/plugins/last-login-method/last-login-method.test.ts (+839 -0)

📄 Description

TLDR:

Adds a beforeStoreCookie hook to the lastLoginMethod plugin that lets you conditionally allow or block storing the last login method cookie (e.g., for GDPR consent), without affecting authentication flow.

issue: https://github.com/better-auth/better-auth/issues/5727
linear: https://linear.app/better-auth/issue/ENG-552/feat-make-lastloginmethod-plugin-have-cookie-gdpr-compliance

  • tests
  • docs

🔄 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/5753 **Author:** [@ping-maxwell](https://github.com/ping-maxwell) **Created:** 11/4/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/last-login-method-beforeStoreCookie` --- ### 📝 Commits (1) - [`80dd936`](https://github.com/better-auth/better-auth/commit/80dd93681902d1d74c08606bdc844b8582a6707b) feat(last-login-method): `beforeStoreCookie` option for GDPR compliance ### 📊 Changes **3 files changed** (+948 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/plugins/last-login-method.mdx` (+73 -0) 📝 `packages/better-auth/src/plugins/last-login-method/index.ts` (+36 -0) 📝 `packages/better-auth/src/plugins/last-login-method/last-login-method.test.ts` (+839 -0) </details> ### 📄 Description ### TLDR: Adds a `beforeStoreCookie` hook to the `lastLoginMethod` plugin that lets you conditionally allow or block storing the last login method cookie (e.g., for GDPR consent), without affecting authentication flow. issue: https://github.com/better-auth/better-auth/issues/5727 linear: https://linear.app/better-auth/issue/ENG-552/feat-make-lastloginmethod-plugin-have-cookie-gdpr-compliance - [x] tests - [x] docs --- <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-04-15 21:29:22 -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#23102