From 6c4c2960710669206baf35c57ff0b95f3559dfc7 Mon Sep 17 00:00:00 2001 From: ztb <67856492+ztbh@users.noreply.github.com> Date: Tue, 13 May 2025 21:55:18 +0800 Subject: [PATCH] Fix the bug of sub-node ss password mismatch --- app/Models/Server.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Models/Server.php b/app/Models/Server.php index 268a9b6..d814f44 100644 --- a/app/Models/Server.php +++ b/app/Models/Server.php @@ -276,7 +276,9 @@ class Server extends Model } $config = self::CIPHER_CONFIGURATIONS[$cipher]; - $serverKey = Helper::getServerKey($this->created_at, $config['serverKeySize']); + // Use parent's created_at if this is a child node + $serverCreatedAt = $this->parent_id ? $this->parent->created_at : $this->created_at; + $serverKey = Helper::getServerKey($serverCreatedAt, $config['serverKeySize']); $userKey = Helper::uuidToBase64($user->uuid, $config['userKeySize']); return "{$serverKey}:{$userKey}"; }