fix(server): prevent duplicate desktop clients after restart
Replace stale local desktop sessions in one transaction. Preserve paired clients and browser sessions, and keep the previous credential valid if replacement fails. Closes https://github.com/pingdotgg/t3code/issues/6283. Original implementation by seeb1337. Reviewed and verified with GPT-6 Astra (preview) in Codex. Co-authored-by: seeb1337 <[email protected]> Co-authored-by: Theo Browne <[email protected]>
This commit is contained in:
1 parent
14bf3f6d16
commit
eb77683e55
8 files changed
+284
-18
No files matched your search
@@ -121,6 +121,12 @@ Sessions issued from a plain bearer exchange use the store's
|
||||
only to DPoP-bound exchanges, where the token is additionally constrained by a
|
||||
proof key. See `SessionStore.ts` and `EnvironmentAuth.ts`.
|
||||
|
||||
The reusable `desktop-bootstrap` grant replaces active sessions with the same
|
||||
subject and authentication method. Revocation and insertion share one database
|
||||
transaction, so a failed insertion preserves the previous credential. This also
|
||||
removes stale local desktop entries from earlier launches. Browser-cookie sessions
|
||||
and sessions issued through pairing links are not replaced.
|
||||
|
||||
Requested scopes must be a subset of the one-time bootstrap credential grant.
|
||||
An ordinary paired client therefore cannot exchange its grant for
|
||||
`access:read`, `access:write`, or `relay:write`.
|
||||
|
||||
@@ -80,6 +80,10 @@ and expiry, and can revoke it if they have access management permission.
|
||||
|
||||
The default endpoint controls the QR code and primary copy action for pairing links. You can change it from the expanded endpoint list. The preference is stored by endpoint type, so choosing the local LAN endpoint survives normal IP address changes when you move between networks.
|
||||
|
||||
After an app restart, the desktop app replaces its previous
|
||||
local credential. Old local desktop entries are removed from **Authorized clients**
|
||||
automatically. Paired phones, browsers, and remote desktop clients keep their access.
|
||||
|
||||
When no user default is saved, the app uses the built-in LAN endpoint for pairing links when
|
||||
available. You can set another endpoint as the default from the expanded endpoint list.
|
||||
|
||||
|
||||
Reference in new issue
Block a user