You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Denying a T3 Connect device that was already approved reports success and leaves it trusted #38419
I searched existing issues and did not find a duplicate.
I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
Turn on Require approval for new T3 Connect devices and have two clients signed in with access:write, for example desktop and the phone app.
Connect a new device through T3 Connect. Both clients show the approval prompt with the device's code.
Approve it on desktop.
Within 10 minutes, tap Deny on the prompt still open on the phone.
Expected behavior
Deny on a request someone has already approved reports that the request is no longer waiting, and the device stays in the T3 Connect devices list where it can be revoked.
Actual behavior
The server answers revoked: true, so the phone treats the denial as done and says nothing. The device stays trusted and connected while the user believes they denied it.
Cause: approveConnectRequest in apps/server/src/auth/PairingGrantStore.ts trusts the device key but leaves the request row unspent, because the device's next relay attempt mints a fresh credential once it is trusted (issueConnectCredentialLocked in EnvironmentAuth.ts). The old row stays active for its 10-minute TTL, and the revoke query in apps/server/src/persistence/AuthPairingLinks.ts only checks revoked_at IS NULL AND consumed_at IS NULL, so it "revokes" a request whose device is already trusted.
Any platform with T3 Connect device approval enabled and more than one approving client.
Logs or stack traces
Reproduced in the existing EnvironmentAuth.test.ts case "holds an untrusted T3 Connect device until it is approved, and revocation cuts it off" by revoking the request right after approveConnectDevice:
AssertionError: expected true to be false // Object.is equality
❯ src/auth/EnvironmentAuth.test.ts:350:68
Activity