feat(auth): require date of birth for new users
Signed-off-by: miguel456 <me@nogueira.codes>
This commit is contained in:
parent
9437d81bfc
commit
1114eb33f1
@ -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');
|
||||
|
@ -72,11 +72,16 @@
|
||||
<label for="password" class="sr-only">{{__('Password')}}</label>
|
||||
<input type="password" name="password" id="password" class="form-control" placeholder="{{__('Password')}}">
|
||||
</div>
|
||||
<div class="form-group mb-4">
|
||||
<div class="form-group mb-2">
|
||||
<label for="passwordc" class="sr-only">{{__('Confirm Password')}}</label>
|
||||
<input type="password" id="passwordc" name="password_confirmation" class="form-control" placeholder="{{__('Confirm Password')}}" />
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-4 mt-5">
|
||||
<label for="dob" class="sr-only">{{__('Date of birth')}}</label>
|
||||
<input type="text" class="form-control" name="dob" id="dob" placeholder="Date of birth">
|
||||
<span class="text-muted text-sm"><i class="fas fa-info-circle"></i> {!! __("<b>Why do we need this?</b> 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.") !!} </span>
|
||||
</div>
|
||||
|
||||
@if(\App\Facades\Options::getOption('requireGameLicense') && \App\Facades\Options::getOption('currentGame') == 'MINECRAFT')
|
||||
<div class="form-group mt-5">
|
||||
@ -86,11 +91,20 @@
|
||||
@endif
|
||||
|
||||
<div class="form-group mt-3">
|
||||
<label for="legal"><input type="checkbox" name="acceptTerms"> {!! __('I am 13 years of age or older and have read and agree with the <a href=":communityGuidelinesUrlConfigValue" target="_blank">Community Guidelines</a>, <a href=":privacyPolicyUrlConfigValue" target="_blank">Privacy Policy</a> and <a href=":termsUrlConfigValue" target="_blank">Terms of Service</a> set forth.', ['communityGuidelinesUrlConfigValue' => config('app.guidelines_url'), 'privacyPolicyUrlConfigValue' => config('app.privacy_url'), 'termsUrlConfigValue' => config('app.terms_url')]) !!}</label>
|
||||
<label for="legal"><input type="checkbox" name="acceptTerms"> {!! __('I have read and agree with the :appName <a href=":communityGuidelinesUrlConfigValue" target="_blank">Community Guidelines</a>, <a href=":privacyPolicyUrlConfigValue" target="_blank">Privacy Policy</a> and <a href=":termsUrlConfigValue" target="_blank">Terms of Service</a>.', ['communityGuidelinesUrlConfigValue' => config('app.guidelines_url'), 'privacyPolicyUrlConfigValue' => config('app.privacy_url'), 'termsUrlConfigValue' => config('app.terms_url'), 'appName' => config('app.name')]) !!}</label>
|
||||
</div>
|
||||
|
||||
<input name="register" id="register" class="btn btn-block login-btn mb-4" type="submit" value="{{__('Sign up')}}">
|
||||
</form>
|
||||
|
||||
<script>
|
||||
flatpickr('#dob', {
|
||||
altInput: true,
|
||||
altFormat: "F j, Y",
|
||||
dateFormat: "Y-m-d",
|
||||
});
|
||||
</script>
|
||||
|
||||
<p class="login-card-footer-text">{{__('Have an account with us?')}} <a href="{{ route('login') }}" class="text-reset">{{__('Sign in here')}}</a></p>
|
||||
<nav class="login-card-footer-nav">
|
||||
<a href="{{ config('app.terms_url') }}">{{__('Terms of Service')}}</a>
|
||||
|
@ -11,6 +11,9 @@
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.css" />
|
||||
<script src="https://kit.fontawesome.com/2d0b1aecfa.js" crossorigin="anonymous"></script>
|
||||
<link rel="stylesheet" href="/css/login.css">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css">
|
||||
<script src="https://cdn.jsdelivr.net/npm/flatpickr"></script>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
Loading…
x
Reference in New Issue
Block a user