From 49ee64ab2f6e64ccaac58a88cbee09a0a5653967 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20Gravel-M=C3=A9nard?= <94582929+alexsoluweb@users.noreply.github.com> Date: Sun, 19 Dec 2021 14:10:10 -0500 Subject: [PATCH] Add ssl verification --- basic-auth.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/basic-auth.php b/basic-auth.php index 1ef6f85..57a14d7 100644 --- a/basic-auth.php +++ b/basic-auth.php @@ -38,9 +38,12 @@ function json_basic_auth_handler( $user ) { add_filter( 'determine_current_user', 'json_basic_auth_handler', 20 ); - if ( is_wp_error( $user ) ) { + if ( is_wp_error( $user )) { $wp_json_basic_auth_error = $user; return null; + }elseif(is_ssl()===false){ + $wp_json_basic_auth_error = __('Connection is not hover SSL'); + return null; } $wp_json_basic_auth_error = true;