tymondesigns / jwt-auth

🔐 JSON Web Token Authentication for Laravel & Lumen
https://jwt-auth.com
MIT License
11.27k stars 1.55k forks source link

Wrong number of segments #2140

Open zkenstein opened 3 years ago

zkenstein commented 3 years ago

Tried this on SSL but return wrong number of segments. Any clue?

my middleware:

 public function handle($request, Closure $next)
    {
        try {           
            // $token = JWTAuth::getToken();            
            $token = JWTAuth::getToken();           
            $getData = JWT::decode((string)$token, env('JWT_SECRET'), ['HS256']);

            if ($getData) {
                return $next($request);

            }
            else {
                return response()->json([
                    'success' => 0,
                    'login' => 1,
                    'message' => ['Client not found'],
                ], 403);
            }

        }
        catch (\Exception $e) {
            return response()->json([
                'success' => 0,
                'login' => 1,
                'message' => [$e->getMessage()],
            ], 403);
        }

    }
zkenstein commented 3 years ago

After enabling modules on apache, it return the Algorithm not allowed. What I am dong wrong?