matrix-appservice-twitter
matrix-appservice-twitter copied to clipboard
OAuth process indicator
At the moment, the provisioning API has no way of exposing OAuth process indication for a given user_id
. When _getOAuthedTimeline
endpoint is called, it won't find a timeline for someone who has not finished OAuth
, falsely indicating that there is no OAuth state to remove. So it is currently impossible to reliably show a "Nuke OAuth State" button and hence impossible for a user of an interface to remove all trace of OAuth from the bridge.
Something like this would be suitable:
GET /_matrix/provision/getOAuthStatus?user_id=bla
{
"status":"pending"
}
where
-
status === "pending"
= OAuth process started. At this point, the unOAuth endpoint can be used to restart. -
status === "success"
= OAuth process finished. Again, the unOAuth endpoint can be used to remove the credentials from the bridge entirely. -
status === "unauthenticated"
= OAuth process not started, indicating that unOAuth will do nothing, and an OAuth process can be started.
Hmm. Yeah that looks okay to me. Out of interest, why unknown? If the OAuth process hasn't started, then you'd probably want "not set" or something. Unknown to me sounds more like a fail state if we loose track of what has happened, when we know the user hasn’t tried to auth.
This is true. How about "unauthenticated"?
Yep, that's fine :+1: