Skip to content

W2: Surface OAuth token health in Connected accounts (verifyIdentity) #92

Description

@Adron

Split out of #64 (see PR #90). APIClient.verifyIdentity(provider:providerId:) has no caller; #64
kept it because it is the only primitive that closes a real gap.

The gap

LinkedIdentitiesView shows each provider's /status (linkedinStatus, twitterStatus,
blueskyStatus, githubStatus, mastodonStatus), but those report whether the provider is
configured server-side
— {"configured":true,…} — not whether this account's stored token still
works
. So a user whose Bluesky or Mastodon token has expired sees a healthy-looking row and has no
way to find out until a cross-post silently fails.

POST /api/user/identities/verify is the route that actually checks: it loads the stored credential
and verifies it (restoring the DPoP-bound session for Bluesky, calling the provider otherwise).

Build this

  • A Check connection action per linked identity in LinkedIdentitiesView, calling
    verifyIdentity(provider:).
  • Show the outcome on the row: verified, or "needs reconnecting" with the existing reconnect
    affordance.
  • Optionally verify all identities on appear — but only if it is cheap; each call hits the
    provider, so a manual action may be the better default.
  • Remove the "no caller yet" comment on the function once wired.

Note

The route reads only provider; the providerId iOS passes is accepted and ignored. Drop the
parameter when wiring, unless #77 (which also touches this area) resolves it differently.

Acceptance criteria

  • An identity with a revoked/expired token reports as needing reconnection.
  • A healthy identity reports as verified.
  • A failure to reach the route is distinguishable from "token is bad".
  • Unit tests for both outcomes.

Files: Views/LinkedIdentitiesView.swift, Services/APIClient.swift:177.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestws:moderation-privacyW2 — moderation, privacy, account settings

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions