restaurant and customer updated
This commit is contained in:
@@ -42,6 +42,9 @@ class CustomerJwtMiddleware
|
||||
}
|
||||
Log::info("Customer jwt");
|
||||
Log::info($user);
|
||||
Log::info($user->principal_type_xid);
|
||||
|
||||
|
||||
|
||||
|
||||
Session::flash('vendorToken', $token);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user