File tree Expand file tree Collapse file tree
config/plugin/tinywan/jwt Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ public static function installByRelation()
5353 }
5454
5555 /**
56- * 安装时初始化JWT密钥(32位随机字符串 )
56+ * 安装时初始化JWT密钥(64位随机字符串 )
5757 * @param string $configFile
5858 * @return void
5959 */
@@ -73,8 +73,8 @@ protected static function initJwtSecrets(string $configFile): void
7373 }
7474
7575 try {
76- $ accessKey = bin2hex (random_bytes (16 ));
77- $ refreshKey = bin2hex (random_bytes (16 ));
76+ $ accessKey = bin2hex (random_bytes (32 ));
77+ $ refreshKey = bin2hex (random_bytes (32 ));
7878 } catch (\Exception $ e ) {
7979 return ;
8080 }
Original file line number Diff line number Diff line change 66 /** 算法类型 HS256、HS384、HS512、RS256、RS384、RS512、ES256、ES384、ES512、PS256、PS384、PS512 */
77 'algorithms ' => 'HS256 ' ,
88
9- /** access令牌秘钥(安装时自动生成32位随机值 ) */
9+ /** access令牌秘钥(安装时自动生成64位随机值 ) */
1010 'access_secret_key ' => '__JWT_ACCESS_SECRET_KEY__ ' ,
1111
1212 /** access令牌过期时间,单位:秒。默认 2 小时 */
1313 'access_exp ' => 7200 ,
1414
15- /** refresh令牌秘钥(安装时自动生成32位随机值 ) */
15+ /** refresh令牌秘钥(安装时自动生成64位随机值 ) */
1616 'refresh_secret_key ' => '__JWT_REFRESH_SECRET_KEY__ ' ,
1717
1818 /** refresh令牌过期时间,单位:秒。默认 7 天 */
You can’t perform that action at this time.
0 commit comments