From 8c7a1f2859b55c1bc080722b0e34bb0ba50068d3 Mon Sep 17 00:00:00 2001 From: miguel456 Date: Sat, 15 Oct 2022 17:52:15 +0100 Subject: [PATCH] feat(auth): remove suspended user check at sign up Signed-off-by: miguel456 --- .../Controllers/Auth/RegisterController.php | 21 +++---------------- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index 703644f..00d0a62 100755 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -64,23 +64,6 @@ class RegisterController extends Controller $this->middleware('guest'); } - public function showRegistrationForm(AccountSuspensionService $service) - { - $users = User::where('currentIp', \request()->ip())->get(); - - foreach ($users as $user) { - if ($user && $service->isSuspended($user)) { - Log::alert('Suspended user attempting to use registration form', [ - 'ip' => \request()->ip(), - 'email' => $user->email - ]); - abort(403, 'You do not have permission to access this page.'); - } - } - - return view('auth.register'); - } - /** * Get a validator for an incoming registration request. * @@ -111,11 +94,13 @@ class RegisterController extends Controller return Validator::make($data, [ 'uuid' => (Options::getOption('requireGameLicense') && Options::getOption('currentGame') == 'MINECRAFT') ? ['required', 'string', 'unique:users', 'min:32', 'max:32'] : ['nullable', 'string'], 'name' => ['required', 'string', 'max:255'], - 'email' => ['required', 'string', 'email:rfc,dns', 'max:255', 'unique:users'], + 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 'dob' => ['required', 'string', 'date_format:Y-m-d', 'before:-13 years'], 'acceptTerms' => ['required', 'accepted'], 'password' => $password, ], [ + 'dob.before' => __('You must be 13 years of age or older in order to sign up for an account.'), + 'dob.required' => __('Please enter your date of birth.'), 'uuid.required' => __('Please enter a valid (and Premium) Minecraft username! We do not support cracked users.'), 'acceptTerms.required' => __('Please accept the Community Guidelines, Terms of Service and Privacy Policy to continue.') ]);