Add all files
This commit is contained in:
43
app/Livewire/Auth/VerifyEmail.php
Normal file
43
app/Livewire/Auth/VerifyEmail.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Auth;
|
||||
|
||||
use App\Helpers\NotificationHelper;
|
||||
use App\Livewire\Component;
|
||||
use App\Traits\Captchable;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\RateLimiter;
|
||||
|
||||
class VerifyEmail extends Component
|
||||
{
|
||||
use Captchable;
|
||||
|
||||
public function mount()
|
||||
{
|
||||
if (Auth::user()->hasVerifiedEmail()) {
|
||||
return redirect()->route('dashboard');
|
||||
}
|
||||
}
|
||||
|
||||
public function submit()
|
||||
{
|
||||
$this->captcha();
|
||||
|
||||
if (RateLimiter::tooManyAttempts('email-verification', 1)) {
|
||||
$this->addError('code', 'Too many attempts. Try again later.');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
NotificationHelper::emailVerificationNotification(Auth::user());
|
||||
|
||||
RateLimiter::hit('email-verification', 120);
|
||||
|
||||
$this->notify('Verification email sent.');
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('auth.verify-email');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user