diff --git a/app/Http/Middleware/CustomerJwtMiddleware.php b/app/Http/Middleware/CustomerJwtMiddleware.php index b537196..f4d4bf7 100644 --- a/app/Http/Middleware/CustomerJwtMiddleware.php +++ b/app/Http/Middleware/CustomerJwtMiddleware.php @@ -42,6 +42,9 @@ class CustomerJwtMiddleware } Log::info("Customer jwt"); Log::info($user); + Log::info($user->principal_type_xid); + + Session::flash('vendorToken', $token); diff --git a/app/Http/Middleware/RestaurantJwtMiddleware.php b/app/Http/Middleware/RestaurantJwtMiddleware.php index 3c0ed74..166bcc4 100644 --- a/app/Http/Middleware/RestaurantJwtMiddleware.php +++ b/app/Http/Middleware/RestaurantJwtMiddleware.php @@ -8,7 +8,7 @@ use Illuminate\Support\Facades\Session; use Symfony\Component\HttpFoundation\Response; use Tymon\JWTAuth\Exceptions\JWTException; use Tymon\JWTAuth\Facades\JWTAuth; - +use Illuminate\Support\Facades\Log; class RestaurantJwtMiddleware { /** @@ -35,9 +35,16 @@ class RestaurantJwtMiddleware $user = JWTAuth::setToken($token)->authenticate(); // Check if the user is of restaurant type - if (!$user ||$user->principal_type_xid !== 4) { + Log::info("Restaurant Jwt"); + + Log::info($user); + + if (!$user ||$user->principal_type_xid != 4) { return response()->json(['status' => 'error', 'status_code' => 401, 'message' => 'Unauthorized access'], 401); } + Log::info("Restaurant Jwt"); + + Log::info($user->principal_type_xid); Session::flash('RestToken', $token); } catch (JWTException $e) {