Răsfoiți Sursa

null token return false

visuddhinanda 3 ani în urmă
părinte
comite
837e5500a2
1 a modificat fișierele cu 3 adăugiri și 0 ștergeri
  1. 3 0
      app/Http/Api/AuthApi.php

+ 3 - 0
app/Http/Api/AuthApi.php

@@ -13,6 +13,9 @@ class AuthApi{
             Log::info('token:'.$token);
             if(\substr($token,0,6) === 'Bearer'){
                 $token = trim(substr($token,6));
+                if($token === "null"){
+                    return false;
+                }
                 $jwt = JWT::decode($token,new Key(env('APP_KEY'),'HS512'));
                 if($jwt->exp < time()){
                     return false;