From b913a85beefcc4f2508fa57d72b3bf4909e46d67 Mon Sep 17 00:00:00 2001 From: Miguel Nogueira Date: Sun, 10 Aug 2025 11:28:00 +0100 Subject: [PATCH] fix: prevent account creation through Discord when registrations are disabled Signed-off-by: Miguel Nogueira --- app/Http/Controllers/Auth/DiscordController.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/Http/Controllers/Auth/DiscordController.php b/app/Http/Controllers/Auth/DiscordController.php index 800a18c..bc9d21f 100644 --- a/app/Http/Controllers/Auth/DiscordController.php +++ b/app/Http/Controllers/Auth/DiscordController.php @@ -21,6 +21,7 @@ namespace App\Http\Controllers\Auth; +use App\Facades\Options; use App\Http\Controllers\Controller; use App\User; use GuzzleHttp\Exception\ClientException; @@ -70,6 +71,14 @@ class DiscordController extends Controller Auth::login($appUser, true); } else { + + if (!Options::getOption('enable_registrations')) + { + return redirect() + ->route('home') + ->with('error', __('Hey there, ' . $discordUser->getName() . '! Sign ups are currently closed so we were not able to create your account. Head over to the sign up page to request an invitation if you\'d like. Alternatively, if you already have an account here, make sure to log in with Discord with the correct account you linked beforehand.')); + } + $oAuthUser = User::create([ 'uuid' => null, 'name' => $discordUser->getName(),