[PR #3659] [MERGED] feat(one-time-token): support setting session cookie on ott verify #13186

Closed
opened 2026-04-13 08:48:56 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/3659
Author: @Bekacru
Created: 7/28/2025
Status: Merged
Merged: 12/14/2025
Merged by: @Bekacru

Base: canaryHead: feat/ott


📝 Commits (6)

  • 5265afa feat(ott): set session cookie on ott verify
  • ee9f3c6 introduce set ott header
  • 98226c5 fix: should use after
  • 4059b16 Merge branch 'canary' into feat/ott
  • dec3403 feat(passkey): delete verification value after successful authentication
  • 8e6e9b1 test

📊 Changes

3 files changed (+235 additions, -13 deletions)

View changed files

📝 packages/better-auth/src/plugins/one-time-token/index.ts (+68 -13)
📝 packages/better-auth/src/plugins/one-time-token/one-time-token.test.ts (+165 -0)
📝 packages/passkey/src/routes.ts (+2 -0)

📄 Description

Summary by cubic

Session cookies are now set automatically when a one-time token is verified, making authentication smoother. New sessions can optionally include a set-ott header for clients that don’t rely on cookies.

  • New Features

    • Added automatic session cookie setting after successful token verification.
    • Added optional set-ott header on new sessions; both behaviors are configurable.
  • Bug Fixes

    • Deleted passkey verification value after successful authentication to prevent stale challenges.

Written for commit 8e6e9b12e1. 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/3659 **Author:** [@Bekacru](https://github.com/Bekacru) **Created:** 7/28/2025 **Status:** ✅ Merged **Merged:** 12/14/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `feat/ott` --- ### 📝 Commits (6) - [`5265afa`](https://github.com/better-auth/better-auth/commit/5265afa78d2b25a2621ac4fa27aaa89951342ee2) feat(ott): set session cookie on ott verify - [`ee9f3c6`](https://github.com/better-auth/better-auth/commit/ee9f3c61d35bd04785abc3ce6894162ac5da9209) introduce set ott header - [`98226c5`](https://github.com/better-auth/better-auth/commit/98226c5d87721472dd75f78fda433cc4bc4a9dc8) fix: should use after - [`4059b16`](https://github.com/better-auth/better-auth/commit/4059b1676d5b734f63bf1240a9e103c3c8642940) Merge branch 'canary' into feat/ott - [`dec3403`](https://github.com/better-auth/better-auth/commit/dec34036ccd8fb355a2976e53f9ac5ea36c5f600) feat(passkey): delete verification value after successful authentication - [`8e6e9b1`](https://github.com/better-auth/better-auth/commit/8e6e9b12e1aac4a64da7212870a95c6f61f6f810) test ### 📊 Changes **3 files changed** (+235 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/one-time-token/index.ts` (+68 -13) 📝 `packages/better-auth/src/plugins/one-time-token/one-time-token.test.ts` (+165 -0) 📝 `packages/passkey/src/routes.ts` (+2 -0) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Session cookies are now set automatically when a one-time token is verified, making authentication smoother. New sessions can optionally include a set-ott header for clients that don’t rely on cookies. - **New Features** - Added automatic session cookie setting after successful token verification. - Added optional set-ott header on new sessions; both behaviors are configurable. - **Bug Fixes** - Deleted passkey verification value after successful authentication to prevent stale challenges. <sup>Written for commit 8e6e9b12e1aac4a64da7212870a95c6f61f6f810. 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-04-13 08:48:56 -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#13186