customer jwt updated
This commit is contained in:
@@ -9,6 +9,7 @@ use Illuminate\Support\Facades\Session;
|
||||
use Tymon\JWTAuth\Exceptions\JWTException;
|
||||
use Illuminate\Http\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class CustomerJwtMiddleware
|
||||
{
|
||||
@@ -32,9 +33,14 @@ class CustomerJwtMiddleware
|
||||
$user = JWTAuth::setToken($token)->authenticate();
|
||||
|
||||
// Check if authentication was successful and user type is correct
|
||||
// if (!$user || $user->principal_type_xid !== 3) {
|
||||
// return response()->json(['status' => 'error', 'status_code' => 401, 'message' => 'Unauthorized access'], 401);
|
||||
// }
|
||||
Log::info("Customer jwt");
|
||||
Log::info($user);
|
||||
|
||||
if (!$user || $user->principal_type_xid !== 3) {
|
||||
return response()->json(['status' => 'error', 'status_code' => 401, 'message' => 'Unauthorized access'], 401);
|
||||
}
|
||||
Log::info("Customer jwt");
|
||||
Log::info($user);
|
||||
|
||||
Session::flash('vendorToken', $token);
|
||||
} catch (JWTException $e) {
|
||||
|
||||
Reference in New Issue
Block a user