From 728a2e5a69fc5835e482f720f88378a91d69ae3c Mon Sep 17 00:00:00 2001 From: ro Date: Sun, 2 Jun 2024 21:33:20 -0600 Subject: [PATCH] incorrect error capture for creating member secret the init process was erroring out because instead of re-running the script to make a valid token, it was not capturing the correct error, so it would just fail also the folder for saving config files needed to be created to save them, so that addition was made as well --- app/Services/Upkeep/InitService.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Services/Upkeep/InitService.php b/app/Services/Upkeep/InitService.php index 0800b70..157172e 100644 --- a/app/Services/Upkeep/InitService.php +++ b/app/Services/Upkeep/InitService.php @@ -3,7 +3,7 @@ namespace App\Services\Upkeep; use ReallySimpleJWT\Token; -use ReallySimpleJWT\Exception\BuildException; +use ReallySimpleJWT\Exception\EncodeException; use App\Services\Assets\DocService; use Carbon\Carbon; @@ -34,7 +34,7 @@ class InitService try { $secret = Token::create(12, $string, time() + 3600, 'localhost'); return $string; - } catch (BuildException $e) { + } catch (EncodeException $e) { //bad secret, so try agiain return self::validSecret(12); } @@ -103,6 +103,7 @@ class InitService ]; //once all files created, write down + mkdir('../content/config', 0755, true); $this->docs->writeSettings($newSettings, '../content/config/settings.json'); $this->docs->writeSettings($newFolks, '../content/config/folks.json'); $this->docs->writeSettings([], '../content/config/tags.json');