Connect events and next= on the OAuth door - #295
Merged
Merged
Conversation
czpython
force-pushed
the
oauth-events
branch
2 times, most recently
from
August 21, 2026 06:14
ef8aaa2 to
a52cd93
Compare
… user back The platform publishes oauth.connected when a consent completes (reconsent marks a token replacement) and oauth.disconnected when a connection dies — revoked, or purged by a client-credential replacement. An extension that keeps per-connection state subscribes instead of sweeping the table on a cron. The connect door takes next, a bare same-origin path that rides the state stash; a successful callback redirects there instead of rendering the terminal page, so an app's own sign-in button lands the user back on its page. Anything host-shaped is rejected — the door is not an open redirect.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two additions to the Connections flow.
Connect events
Extensions that keep per-connection state (a sync cursor, an enable flag)
had no way to hear about a new sign-in — the callback stored the row and
rendered a terminal page, leaving apps to sweep
list_for_provideron acron. The platform now publishes on the existing signal machinery:
oauth.connected— after the callback stores a connection, bothbranches;
reconsentis true when it replaced an existing connection'stokens. Fields:
provider,connection_id,account_id,reconsent.oauth.disconnected— when a connection dies: revoked from theConnections page, or purged because the service's client credentials
were replaced. Same fields, no
reconsent.next= on the connect door
GET /api/oauth/{name}/connect?next=/app/night_watch/accountsridesthe pending-state stash; a successful callback redirects there instead of
rendering the "connected" page, so an app's sign-in button lands the user
back on its own page. Only a bare same-origin path is accepted — it must
start with
/and anything host-shaped (//…,/\…, a scheme) isrejected with 422, so the door cannot become an open redirect.
Both are documented next to the connections section in
writing-an-extension.md.