mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-23 16:24:29 +00:00
Update Auth controller
This commit is contained in:
parent
85dc4ca0b2
commit
b885cccd6b
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