Skip to content

Revoke and Remove Tokens on Disconnect#132

Open
n7studios wants to merge 4 commits intomainfrom
revoke-remove-tokens-disconnect
Open

Revoke and Remove Tokens on Disconnect#132
n7studios wants to merge 4 commits intomainfrom
revoke-remove-tokens-disconnect

Conversation

@n7studios
Copy link
Copy Markdown
Contributor

Summary

When the user clicks the Disconnect link at WPForms > Settings > Integrations > Kit for the specific Kit connection:

  • Revokes the access and refresh tokens by calling the oauth/revoke endpoint

Unlike the other Kit Plugins, WPForms provides this 'Disconnect' functionality, and therefore will always remove the connection, including its v3/v4 credentials. As such, this Plugin doesn't need to listen to the convertkit_api_revoke_tokens hook to remove credentials, as WPForms always (and already) does this for us when the user clicks Disconnect.

Adds named parameters to tests that were missing for consistency.

Testing

  • testCredentialsAndResourcesAreDeletedOnDisconnect: end to end test confirming that the API Key, API Secret, Access Token and Refresh Token are deleted from the Plugin.
  • testCredentialsDeletedAndInvalidWhenRevoked: integration test confirming that the credentials are deleted from the Plugin and no longer work i.e. are revoked, when the API's revoke_tokens method is called.

Checklist

WPForms provides the ‘Disconnect’ functionality, and it will always remove the connection (which includes API Key, Secret, Tokens etc). There’s no need to go and remove these settings via listening to the `convertkit_api_revoke_tokens` action.

Updates tests to confirm token revokation works and WPForms truly removes the credentials upstream.
@n7studios n7studios self-assigned this Apr 10, 2026
@n7studios n7studios added the enhancement New feature or request label Apr 10, 2026
@n7studios n7studios requested review from a team, ciccio-kit and noelherrick and removed request for a team April 10, 2026 11:42
@n7studios n7studios marked this pull request as ready for review April 10, 2026 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants