1
0
Fork 1
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:
Daniel Supernault 2019-08-09 13:33:02 -06:00
parent 85dc4ca0b2
commit b885cccd6b
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7
2 changed files with 34 additions and 0 deletions

View file

@ -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.
*

File diff suppressed because one or more lines are too long