'invalid_request' ), array( 'Allow' => 'POST', 'Cache-Control' => 'no-store' ) ); } if ( AgentAdapt_Http::token_in_query() ) { AgentAdapt_Http::oauth_error( 400, 'invalid_request', 'credentials are never accepted in the URL' ); } $form = AgentAdapt_Http::form(); $agent = AgentAdapt_Client_Auth::authenticate( $form ); if ( is_wp_error( $agent ) ) { if ( 'rate_limited' === $agent->get_error_code() ) { AgentAdapt_Http::rate_limited( 3600 ); } AgentAdapt_Http::oauth_error( 401, 'invalid_client', $agent->get_error_message() ); } if ( empty( $form['token'] ) ) { AgentAdapt_Http::oauth_error( 400, 'invalid_request', 'token is required' ); } /** * Revoke an Account Token issued to this agent (Phase 2 attaches here). * * @param string $token Token. * @param array $agent Authenticated agent. */ do_action( 'agentadapt_revoke_token', (string) $form['token'], $agent ); AgentAdapt_Http::json( 200, array(), array( 'Cache-Control' => 'no-store' ) ); } }