Kaynağa Gözat

add jwt_secrets_key

visuddhinanda 2 ay önce
ebeveyn
işleme
4c9a93129c
1 değiştirilmiş dosya ile 6 ekleme ve 1 silme
  1. 6 1
      api-v12/app/Http/Api/AuthApi.php

+ 6 - 1
api-v12/app/Http/Api/AuthApi.php

@@ -9,6 +9,10 @@ use Firebase\JWT\Key;
 
 
 class AuthApi
 class AuthApi
 {
 {
+    public static function getJwtKey()
+    {
+        return config('mint.app.jwt_secrets_key');
+    }
     public static function getToken(Request $request)
     public static function getToken(Request $request)
     {
     {
         $token = $request->bearerToken();
         $token = $request->bearerToken();
@@ -19,7 +23,8 @@ class AuthApi
         $token = $request->bearerToken();
         $token = $request->bearerToken();
         if ($token) {
         if ($token) {
             try {
             try {
-                $jwt = JWT::decode($token, new Key(config('app.key'), 'HS512'));
+
+                $jwt = JWT::decode($token, new Key(self::getJwtKey(), 'HS512'));
             } catch (\Exception $e) {
             } catch (\Exception $e) {
                 return false;
                 return false;
             }
             }