diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index 9a41f2e01..fe9aa7fde 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -44,6 +44,13 @@ class RegisterController extends Controller $this->middleware('guest'); } + public function getRegisterToken() + { + return \Cache::remember('pf:register:rt', 900, function() { + return str_random(40); + }); + } + /** * Get a validator for an incoming registration request. * @@ -110,8 +117,18 @@ class RegisterController extends Controller }, ]; + $rt = [ + 'required', + function ($attribute, $value, $fail) { + if($value !== $this->getRegisterToken()) { + return $fail('Something went wrong'); + } + } + ]; + $rules = [ 'agecheck' => 'required|accepted', + 'rt' => $rt, 'name' => 'nullable|string|max:'.config('pixelfed.max_name_length'), 'username' => $usernameRules, 'email' => $emailRules, diff --git a/public/css/spa.css b/public/css/spa.css index faf165885..2efa119ac 100644 Binary files a/public/css/spa.css and b/public/css/spa.css differ diff --git a/public/mix-manifest.json b/public/mix-manifest.json index cc2b7bfe7..60440f595 100644 Binary files a/public/mix-manifest.json and b/public/mix-manifest.json differ diff --git a/resources/views/auth/register.blade.php b/resources/views/auth/register.blade.php index f68afb614..5f3b6e503 100644 --- a/resources/views/auth/register.blade.php +++ b/resources/views/auth/register.blade.php @@ -10,7 +10,7 @@