[PR #7872] [MERGED] chore(electron) add openapi metadata to routes #7603

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7872
Author: @jslno
Created: 2/9/2026
Status: Merged
Merged: 2/10/2026
Merged by: @himself65

Base: canaryHead: 02-08-2026/electron-openapi


📝 Commits (3)

  • a0f9697 feat(electron): allow quick transfer for signed-in users (#7869)
  • 26ba2ad chore(electron): add openapi metadata to routes
  • 5f0e631 chore: fix linting

📊 Changes

8 files changed (+522 additions, -61 deletions)

View changed files

demo/nextjs/app/(auth)/sign-in/_components/electron.tsx (+150 -0)
📝 demo/nextjs/app/(auth)/sign-in/page.tsx (+53 -18)
📝 docs/content/docs/integrations/electron.mdx (+2 -0)
📝 packages/electron/src/error-codes.ts (+1 -0)
📝 packages/electron/src/index.ts (+65 -41)
📝 packages/electron/src/proxy.ts (+5 -0)
📝 packages/electron/src/routes.ts (+143 -2)
📝 packages/electron/test/electron.test.ts (+103 -0)

📄 Description

Downstream #7869


Summary by cubic

Add quick user transfer from the web app to the Electron app, with OpenAPI docs for Electron routes, so signed-in users can switch devices with one click.

  • New Features

    • Server: POST /electron/transfer-user to hand off the current session; validates client_id, sets redirect cookie, returns { url, redirect } honoring optional callbackURL.
    • Client: proxy exposes electron.transferUser (POST /electron/transfer-user).
    • Demo: “Continue as” UI on sign-in lists device sessions and transfers the selected user; handles temporary session switching.
    • OpenAPI: metadata added for electronToken, electronInitOAuthProxy, and electronTransferUser.
    • Errors: added INVALID_CLIENT_ID.
  • Refactors

    • Extracted handleTransfer for reuse in sign-up flow and transfer-user.
    • Tests cover transferUser (callbackURL behavior, invalid client_id, cookie set).
    • Docs updated with guidance and example link.

Written for commit 5f0e6313a1. Summary will update 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/7872 **Author:** [@jslno](https://github.com/jslno) **Created:** 2/9/2026 **Status:** ✅ Merged **Merged:** 2/10/2026 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `02-08-2026/electron-openapi` --- ### 📝 Commits (3) - [`a0f9697`](https://github.com/better-auth/better-auth/commit/a0f9697bb6cae1ed368dc0e32e59ee8b5d221103) feat(electron): allow quick transfer for signed-in users (#7869) - [`26ba2ad`](https://github.com/better-auth/better-auth/commit/26ba2ad86dfab47d6e6a6e9856f373766a3437d5) chore(electron): add openapi metadata to routes - [`5f0e631`](https://github.com/better-auth/better-auth/commit/5f0e6313a1e55f11116b4361f812a8f08778303f) chore: fix linting ### 📊 Changes **8 files changed** (+522 additions, -61 deletions) <details> <summary>View changed files</summary> ➕ `demo/nextjs/app/(auth)/sign-in/_components/electron.tsx` (+150 -0) 📝 `demo/nextjs/app/(auth)/sign-in/page.tsx` (+53 -18) 📝 `docs/content/docs/integrations/electron.mdx` (+2 -0) 📝 `packages/electron/src/error-codes.ts` (+1 -0) 📝 `packages/electron/src/index.ts` (+65 -41) 📝 `packages/electron/src/proxy.ts` (+5 -0) 📝 `packages/electron/src/routes.ts` (+143 -2) 📝 `packages/electron/test/electron.test.ts` (+103 -0) </details> ### 📄 Description Downstream #7869 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Add quick user transfer from the web app to the Electron app, with OpenAPI docs for Electron routes, so signed-in users can switch devices with one click. - **New Features** - Server: POST /electron/transfer-user to hand off the current session; validates client_id, sets redirect cookie, returns { url, redirect } honoring optional callbackURL. - Client: proxy exposes electron.transferUser (POST /electron/transfer-user). - Demo: “Continue as” UI on sign-in lists device sessions and transfers the selected user; handles temporary session switching. - OpenAPI: metadata added for electronToken, electronInitOAuthProxy, and electronTransferUser. - Errors: added INVALID_CLIENT_ID. - **Refactors** - Extracted handleTransfer for reuse in sign-up flow and transfer-user. - Tests cover transferUser (callbackURL behavior, invalid client_id, cookie set). - Docs updated with guidance and example link. <sup>Written for commit 5f0e6313a1e55f11116b4361f812a8f08778303f. Summary will update 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 13:42: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#7603