15m44z 续(20:54):修 fresh flag 路径 bug

gh_oauth.php / gh_cfg.php:dirname(__DIR__) 误解析到站点根 /,fresh flag 写到 /gh_oauth_fresh(不存在);
改 __DIR__/.. = /plugin,flag 文件写到 /plugin/gh_oauth_fresh/(已 FTP 创建)。
This commit is contained in:
ypsdf1
2026-11-26 20:55:27 +08:00
parent 6bae0bab5e
commit 9fb5a85e0c
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -71,7 +71,7 @@ if ($cfg['gh_enabled'] && $probeTk !== '') {
if ($trow && !empty($trow['access_token'])) {
// ★ 15m44z 续(19:59 根治):OAuth 回调 fresh flag(10min,按玩家名)→ 免验活必有效。
// 彻底避开 CF 边缘 /user 验活偶发 401 把刚授权的有效 token 误判成「可能已失效」。
$freshDir = dirname(__DIR__) . '/../gh_oauth_fresh';
$freshDir = __DIR__ . '/../gh_oauth_fresh';
$freshFlag = $freshDir . '/' . md5($probePlayer) . '.json';
if (is_readable($freshFlag)) {
if (is_array($ff) && (int)$ff['exp'] > time() && (string)($ff['player'] ?? '') === $probePlayer) {
+1 -1
View File
@@ -205,7 +205,7 @@ if ($code !== '') {
// ★ 15m44z 续(19:59 根治):OAuth 回调成功后写 fresh flag(短期 10min,按玩家名)
// gh_cfg 读到 flag → 免 /user 验活直接判有效,彻底避开 CF 边缘偶发 401 把刚授权的有效
// token 误判成「token 可能已失效」。flag 路径 __DIR__/../gh_oauth_fresh/{player}.json
$freshDir = dirname(__DIR__) . '/../gh_oauth_fresh';
$freshDir = __DIR__ . '/../gh_oauth_fresh';
@mkdir($freshDir, 0755, true);
@file_put_contents($freshDir . '/' . md5($player) . '.json', json_encode([
'player' => $player, 'ts' => time(), 'exp' => time() + 600,