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(),