From 9e77205820437b1a41c362df5c0a19fcb0f6e61b Mon Sep 17 00:00:00 2001 From: Miguel Nogueira Date: Thu, 7 Aug 2025 23:09:50 +0100 Subject: [PATCH] fix: set username based on game license requirement while both slack notifs and licence req are active Fixes a problem where sign ups would fail due to a misconfigured UUID middleware that would only trigger if slack notifications were active Signed-off-by: Miguel Nogueira --- app/Http/Middleware/UsernameUUID.php | 6 ++++++ app/Notifications/NewUser.php | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/Http/Middleware/UsernameUUID.php b/app/Http/Middleware/UsernameUUID.php index 32c8a8e..fbeeab3 100644 --- a/app/Http/Middleware/UsernameUUID.php +++ b/app/Http/Middleware/UsernameUUID.php @@ -22,6 +22,8 @@ namespace App\Http\Middleware; use App\Facades\UUID; + +use App\Options; use Closure; class UsernameUUID @@ -35,6 +37,10 @@ class UsernameUUID */ public function handle($request, Closure $next) { + if (!\App\Facades\Options::getOption('requireGameLicense')) { + return $next($request); + } + $input = $request->all(); if (isset($input['uuid'])) { try { diff --git a/app/Notifications/NewUser.php b/app/Notifications/NewUser.php index cae1583..626b550 100644 --- a/app/Notifications/NewUser.php +++ b/app/Notifications/NewUser.php @@ -82,7 +82,7 @@ class NewUser extends Notification implements ShouldQueue $user['name'] = $this->user->name; $user['email'] = $this->user->email; - $user['username'] = UUID::toUsername($this->user->uuid); + $user['username'] = Options::getOption('requireGameLicense') ? UUID::toUsername($this->user->uuid) : $this->user->username; $date = \Carbon\Carbon::parse($this->user->created_at); $user['created_at'] = $date->englishMonth.' '.$date->day.' '.$date->year;