PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.7.0
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.7.0
1.7.0 1.6.6 1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 1.3.20 All 50 releases
← All changes | app/Http/Controllers/FrontendControllers/BaseFrontendController.php +3 -2 1.3.28 → 1.7.0 View file →
@@ -3,8 +3,9 @@
3 3 namespace FluentCart\App\Http\Controllers\FrontendControllers;
4 4
5 5 use FluentCart\Api\Resource\CustomerResource;
6 6 use FluentCart\App\Http\Controllers\Controller;
7 +use FluentCart\App\Services\CustomerIdentity\EmailVerificationService;
7 8
8 9 class BaseFrontendController extends Controller
9 10 {
10 11 /**
@@ -13,9 +14,9 @@
13 14 * @return \WP_REST_Response|null Returns an error response if the user is not logged in; otherwise, returns null.
14 15 */
15 16 protected function checkUserLoggedIn(): ?\WP_REST_Response
16 17 {
17 - $customer = CustomerResource::getCurrentCustomer();
18 + $customer = CustomerResource::getCurrentCustomer(!EmailVerificationService::isEnabled());
18 19 // Check if the user is logged in, return an error if not
19 20 if (empty($customer)) {
20 21 return $this->sendError([
21 22 'message' => __('You are not logged in', 'fluent-cart')
@@ -24,5 +25,5 @@
24 25
25 26 // User is logged in return null
26 27 return null;
27 28 }
28 -}
29 +}