From e503a8da85491c906347a40d6c3603e83c85cb65 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Wed, 29 Dec 2021 00:38:08 -0700 Subject: [PATCH 1/2] Update RegisterController --- .../Controllers/Auth/RegisterController.php | 17 +++++++++++++++++ resources/views/auth/register.blade.php | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) 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/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 @@
@csrf - +
From af68872a8153fb0e9c651b74f3b41a9444126033 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Wed, 29 Dec 2021 00:51:22 -0700 Subject: [PATCH 2/2] Update compiled assets --- public/css/spa.css | Bin 3256 -> 3300 bytes public/mix-manifest.json | Bin 1983 -> 1983 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/public/css/spa.css b/public/css/spa.css index faf16588517155cf17c4b43607c2c80f8c7f2f6e..2efa119ac04864eae15667308f1411986ff3f7f3 100644 GIT binary patch delta 52 zcmdlX`9yNV4jvu7Z#mwA-{GyV? Hypmb~9jFu* delta 7 OcmaDNxkGZp4jupwVFN<| diff --git a/public/mix-manifest.json b/public/mix-manifest.json index cc2b7bfe76883f30dc814a6f871e5e621b887cb7..60440f595a951883962532345fe9d291e0b11fe5 100644 GIT binary patch delta 32 ncmdnbzn_1DER(R2u~A}bT1t|UrG