[PR #3326] [CLOSED] feat(session): add updateSession API endpoint #4757

Closed
opened 2026-03-13 11:58:48 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/3326
Author: @aleclarson
Created: 7/10/2025
Status: Closed

Base: mainHead: feat/updateSession-endpoint


📝 Commits (2)

  • 11a70b5 feat(session): add updateSession API endpoint
  • fb09329 fix: make updateSession endpoint public

📊 Changes

2 files changed (+79 additions, -0 deletions)

View changed files

📝 packages/better-auth/src/api/index.ts (+2 -0)
📝 packages/better-auth/src/api/routes/session.ts (+77 -0)

📄 Description

Adds an /update-session endpoint, allowing you to update the current session.

Currently, it only allows you to convert the session from a long-lived one into a temporary session (stored 1 day by the server and using session storage for the cookies).

This is useful for sign-in flows that prefer to ask about session persistence after authentication is successful.


🔄 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/3326 **Author:** [@aleclarson](https://github.com/aleclarson) **Created:** 7/10/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/updateSession-endpoint` --- ### 📝 Commits (2) - [`11a70b5`](https://github.com/better-auth/better-auth/commit/11a70b5e0aeaf8713e3a37ec62e77533479ff832) feat(session): add `updateSession` API endpoint - [`fb09329`](https://github.com/better-auth/better-auth/commit/fb0932962d0915e49eba83a642f0306c6c93dbaa) fix: make updateSession endpoint public ### 📊 Changes **2 files changed** (+79 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/api/index.ts` (+2 -0) 📝 `packages/better-auth/src/api/routes/session.ts` (+77 -0) </details> ### 📄 Description Adds an `/update-session` endpoint, allowing you to update the current session. Currently, it only allows you to convert the session from a long-lived one into a temporary session (stored 1 day by the server and using session storage for the cookies). This is useful for sign-in flows that prefer to ask about session persistence after authentication is successful. --- <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 11:58:48 -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#4757