kopia lustrzana https://github.com/pixelfed/pixelfed
commit
2dc22dc50c
|
@ -10,6 +10,7 @@ use Illuminate\Support\Facades\Hash;
|
||||||
use Illuminate\Support\Facades\Validator;
|
use Illuminate\Support\Facades\Validator;
|
||||||
use Illuminate\Auth\Events\Registered;
|
use Illuminate\Auth\Events\Registered;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
use App\Services\EmailService;
|
||||||
|
|
||||||
class RegisterController extends Controller
|
class RegisterController extends Controller
|
||||||
{
|
{
|
||||||
|
@ -53,6 +54,8 @@ class RegisterController extends Controller
|
||||||
protected function validator(array $data)
|
protected function validator(array $data)
|
||||||
{
|
{
|
||||||
$this->validateUsername($data['username']);
|
$this->validateUsername($data['username']);
|
||||||
|
$this->validateEmail($data['email']);
|
||||||
|
|
||||||
$usernameRules = [
|
$usernameRules = [
|
||||||
'required',
|
'required',
|
||||||
'min:2',
|
'min:2',
|
||||||
|
@ -105,6 +108,14 @@ class RegisterController extends Controller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function validateEmail($email)
|
||||||
|
{
|
||||||
|
$banned = EmailService::isBanned($email);
|
||||||
|
if($banned) {
|
||||||
|
return abort(403, 'Invalid email.');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show the application registration form.
|
* Show the application registration form.
|
||||||
*
|
*
|
||||||
|
|
File diff suppressed because one or more lines are too long
Ładowanie…
Reference in New Issue