浏览代码

add jwt_secrets_key

visuddhinanda 2 月之前
父节点
当前提交
4c9a93129c
共有 1 个文件被更改,包括 6 次插入1 次删除
  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
 {
+    public static function getJwtKey()
+    {
+        return config('mint.app.jwt_secrets_key');
+    }
     public static function getToken(Request $request)
     {
         $token = $request->bearerToken();
@@ -19,7 +23,8 @@ class AuthApi
         $token = $request->bearerToken();
         if ($token) {
             try {
-                $jwt = JWT::decode($token, new Key(config('app.key'), 'HS512'));
+
+                $jwt = JWT::decode($token, new Key(self::getJwtKey(), 'HS512'));
             } catch (\Exception $e) {
                 return false;
             }