← 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 | +} | |