Files
YwxAppThink/config/jwt.php
T

29 lines
1.1 KiB
PHP

<?php
// +----------------------------------------------------------------------
// | YwxApp [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2026-2036 http://ywxapp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: ywxapp<admin@ywxapp.cn>
// +----------------------------------------------------------------------
// config/jwt.php
return [
// 签名算法:HS256 / RS256
'algorithm' => 'HS256',
// 对称密钥(HS256 使用)
'secret' => env('JWT_SECRET', 'your-default-secret-key-change-in-production'),
// 非对称密钥路径(RS256 使用)
'private_key_path' => root_path() . 'keys/private.key',
'public_key_path' => root_path() . 'keys/public.key',
// Token 配置
'access_ttl' => 1800, // Access Token 有效期(秒)→ 30分钟
'refresh_ttl' => 604800, // Refresh Token 有效期(秒)→ 7天
// JWT 标准声明
'issuer' => 'https://your-app.com',
'audience' => 'https://api.your-app.com',
];