From 1114eb33f14fb337f869520920489e51494eeb98 Mon Sep 17 00:00:00 2001 From: miguel456 Date: Sat, 15 Oct 2022 17:10:25 +0100 Subject: [PATCH] feat(auth): require date of birth for new users Signed-off-by: miguel456 --- .../Controllers/Auth/RegisterController.php | 6 ++++-- resources/views/auth/register.blade.php | 18 ++++++++++++++++-- .../views/breadcrumbs/auth/main.blade.php | 3 +++ 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index af56643..703644f 100755 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -111,7 +111,8 @@ 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', 'max:255', 'unique:users'], + 'email' => ['required', 'string', 'email:rfc,dns', 'max:255', 'unique:users'], + 'dob' => ['required', 'string', 'date_format:Y-m-d', 'before:-13 years'], 'acceptTerms' => ['required', 'accepted'], 'password' => $password, ], [ @@ -136,7 +137,8 @@ class RegisterController extends Controller 'email' => $data['email'], 'password' => Hash::make($data['password']), 'registrationIp' => $ip, - 'currentIp' => $ip + 'currentIp' => $ip, + 'dob' => $data['dob'] ]); $user->assignRole('user'); diff --git a/resources/views/auth/register.blade.php b/resources/views/auth/register.blade.php index 5254bcc..e993c46 100755 --- a/resources/views/auth/register.blade.php +++ b/resources/views/auth/register.blade.php @@ -72,11 +72,16 @@ -
+
+
+ + + {!! __("Why do we need this? We use your age information to make sure you meet age requirements for certain positions, and to make sure that everyone is compliant with our terms of service.") !!} +
@if(\App\Facades\Options::getOption('requireGameLicense') && \App\Facades\Options::getOption('currentGame') == 'MINECRAFT')
@@ -86,11 +91,20 @@ @endif
- +
+ + +