forked from mirror/pixelfed
Merge pull request #1582 from pixelfed/frontend-ui-refactor
Update Auth controller
This commit is contained in:
commit
2dc22dc50c
2 changed files with 34 additions and 0 deletions
|
@ -10,6 +10,7 @@ use Illuminate\Support\Facades\Hash;
|
|||
use Illuminate\Support\Facades\Validator;
|
||||
use Illuminate\Auth\Events\Registered;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Services\EmailService;
|
||||
|
||||
class RegisterController extends Controller
|
||||
{
|
||||
|
@ -53,6 +54,8 @@ class RegisterController extends Controller
|
|||
protected function validator(array $data)
|
||||
{
|
||||
$this->validateUsername($data['username']);
|
||||
$this->validateEmail($data['email']);
|
||||
|
||||
$usernameRules = [
|
||||
'required',
|
||||
'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.
|
||||
*
|
||||
|
|
23
app/Services/EmailService.php
Normal file
23
app/Services/EmailService.php
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue