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