From 06477ffdc6965d74d68bbd0d08f86460283b8819 Mon Sep 17 00:00:00 2001 From: Kostya Bats Date: Tue, 7 Oct 2025 00:15:53 +0300 Subject: [PATCH] hostgetkey store token before save in db and return --- packages/web/status/hostgetkey.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/web/status/hostgetkey.php b/packages/web/status/hostgetkey.php index 0d640cb00a..abdb801a4f 100644 --- a/packages/web/status/hostgetkey.php +++ b/packages/web/status/hostgetkey.php @@ -36,15 +36,16 @@ throw new Exception(_('Host token is currently in use')); } if (!FOGCore::$Host->get('token')) { + $newToken = FOGCore::createSecToken(); FOGCore::getClass('HostManager')->update( ['id' => FOGCore::$Host->get('id')], '', [ - 'token' => FOGCore::createSecToken(), + 'token' => $newToken, 'tokenlock' => true ] ); - throw new Exception(FOGCore::$Host->get('token')); + throw new Exception($newToken); } if (FOGCore::$Host->isValid() && !FOGCore::$Host->get('tokenlock')) { FOGCore::getClass('HostManager')->update(