mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 14:31:26 +00:00
Update RegisterController, bump min password length from 6 to 8
This commit is contained in:
parent
2cccbd772a
commit
f22a4b2d75
1 changed files with 10 additions and 7 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue