Update AppRegisterController

pull/6107/head
Daniel Supernault 1 month ago
parent 9eb9d87a1f
commit 3977137d02
No known key found for this signature in database
GPG Key ID: 23740873EE6F76A1

@ -51,9 +51,9 @@ class AppRegisterController extends Controller
DB::beginTransaction();
$exists = AppRegister::whereEmail($email)->where('created_at', '>', now()->subHours(24))->count();
$exists = AppRegister::whereEmail($email)->count();
if ($exists && $exists > 3) {
if ($exists) {
$errorParams = http_build_query([
'status' => 'error',
'message' => 'Too many attempts, please try again later.',
@ -102,7 +102,7 @@ class AppRegisterController extends Controller
}
$this->validate($request, [
'email' => 'required|email:rfc,dns,spoof,strict|unique:users,email',
'email' => 'required|email:rfc,dns,spoof,strict|unique:users,email|exists:app_registers,email',
'verify_code' => ['required', 'digits:6', 'numeric'],
]);
@ -111,7 +111,7 @@ class AppRegisterController extends Controller
$exists = AppRegister::whereEmail($email)
->whereVerifyCode($code)
->where('created_at', '>', now()->subHours(4))
->where('created_at', '>', now()->subDays(220))
->exists();
return response()->json([
@ -204,7 +204,7 @@ class AppRegisterController extends Controller
}
$this->validate($request, [
'email' => 'required|email:rfc,dns,spoof,strict|unique:users,email',
'email' => 'required|email:rfc,dns,spoof,strict|unique:users,email|exists:app_registers,email',
'verify_code' => ['required', 'digits:6', 'numeric'],
'username' => $this->validateUsernameRule(),
'name' => 'nullable|string|max:'.config('pixelfed.max_name_length'),
@ -219,7 +219,7 @@ class AppRegisterController extends Controller
$exists = AppRegister::whereEmail($email)
->whereVerifyCode($code)
->where('created_at', '>', now()->subHours(4))
->where('created_at', '>', now()->subDays(220))
->exists();
if (! $exists) {

Loading…
Cancel
Save