How to test Clef logout hooks from the command line

To test a Clef logout hook from the command line, send the following test HTTP request via CURL:

curl --data 'logout_token=1234567890' -H 'User-Agent: Clef/1.0 ('

The expected result is {"success":true}. Otherwise, you will receive an HTTP error code, which you may use to debug the logout hook implementation.

  • If you are testing a WordPress site, the default path to the logout hook is /wp-login.php (or its renamed equivalent; i.e., the value returned by wp_login_url()).
  • If your web host is WP Engine, the path to the logout hook is /wp-login.php?wpe-login=clef
  • If the result of the CURL request is either a javascript or a full HTML page rather than an expected JSON response, then it is likely your request is being intercepted by a firewall; see this guide for assistance with Clef logins and firewalls.