Sfoglia il codice sorgente

null token return false

visuddhinanda 3 anni fa
parent
commit
837e5500a2
1 ha cambiato i file con 3 aggiunte e 0 eliminazioni
  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;