LLMS_REST_Authentication::send_unauthorized_headers( WP_REST_Response $response )

Return a WWW-Authenticate header error message when incorrect creds are supplied


Parameters Parameters

$response

(WP_REST_Response) (Required) Current response being served.


Top ↑

Return Return

(WP_REST_Response)


Top ↑

Source Source

File: libraries/lifterlms-rest/includes/class-llms-rest-authentication.php

	 */
	public function send_unauthorized_headers( $response ) {

		if ( is_wp_error( $this->get_error() ) ) {
			$auth_message = __( 'LifterLMS REST API', 'lifterlms' );
			$response->header( 'WWW-Authenticate', 'Basic realm="' . $auth_message . '"', true );
		}

		return $response;



Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.