Update RegisterController, bump min password length from 6 to 8

This commit is contained in:
Daniel Supernault 2019-08-17 01:40:53 -06:00
parent 2cccbd772a
commit f22a4b2d75
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -76,7 +76,7 @@ class RegisterController extends Controller
'name' => 'required|string|max:'.config('pixelfed.max_name_length'),
'username' => $usernameRules,
'email' => 'required|string|email|max:255|unique:users',
'password' => 'required|string|min:6|confirmed',
'password' => 'required|string|min:8|confirmed',
];
return Validator::make($data, $rules);
@ -123,14 +123,17 @@ class RegisterController extends Controller
*/
public function showRegistrationForm()
{
$count = User::count();
$limit = config('pixelfed.max_users');
if($limit && $limit <= $count) {
$view = 'site.closed-registration';
if(config('pixelfed.open_registration')) {
$limit = config('pixelfed.max_users');
if($limit) {
abort_if($limit <= User::count(), 404);
return view('auth.register');
} else {
return view('auth.register');
}
} else {
$view = config('pixelfed.open_registration') == true ? 'auth.register' : 'site.closed-registration';
abort(404);
}
return view($view);
}
/**