From 09da9b47fe36affd35f3d7c808fa5773adcf6ac4 Mon Sep 17 00:00:00 2001 From: Kekskurse Date: Tue, 12 Jan 2021 20:56:51 +0100 Subject: [PATCH] Stuff --- app/Http/Controllers/AccountController.php | 6 ++++++ resources/views/account/login.blade.php | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php index dcefb89..b9e82cd 100644 --- a/app/Http/Controllers/AccountController.php +++ b/app/Http/Controllers/AccountController.php @@ -17,10 +17,16 @@ class AccountController extends BaseController use AuthorizesRequests, DispatchesJobs, ValidatesRequests; public function registerView() { + if(!env('REGISTER_ENABLED')){ + return abort(401); + } return view("account.register"); } public function register(Request $request) { + if(!env('REGISTER_ENABLED')){ + return abort(401); + } $validated = $request->validate([ 'username' => 'required|unique:users|unique:tenants,url|regex:/^[a-z0-9]{8,30}$/i', 'email' => 'required|unique:users|email:rfc,dns', diff --git a/resources/views/account/login.blade.php b/resources/views/account/login.blade.php index 32b6543..3b1da96 100644 --- a/resources/views/account/login.blade.php +++ b/resources/views/account/login.blade.php @@ -16,7 +16,9 @@ - Register + @if (env('REGISTER_ENABLED')) + Register + @endif