before testing verification mecanisum
This commit is contained in:
1 parent
ab2d458387
commit
af567c2c5f
10 files changed
+147
-35
No files matched your search
@@ -34,6 +34,13 @@ class AuthenticatedSessionController extends Controller
|
||||
if (Auth::attempt($credentials)) {
|
||||
$request->session()->regenerate();
|
||||
|
||||
if (!$request->user()->hasVerifiedEmail()) {
|
||||
Auth::logout();
|
||||
return redirect()->route('verification.notice')->withErrors([
|
||||
'email' => 'You need to verify your email address before logging in.',
|
||||
]);
|
||||
}
|
||||
|
||||
return redirect()->route('family.dashboard');
|
||||
}
|
||||
|
||||
|
||||
@@ -61,8 +61,6 @@ class RegisteredUserController extends Controller
|
||||
// Send welcome email
|
||||
Mail::to($user->email)->send(new WelcomeEmail($user, $user, null));
|
||||
|
||||
Auth::login($user);
|
||||
|
||||
return redirect()->route('login')->with('success', 'Registration successful! Please login with your credentials.');
|
||||
return redirect()->route('verification.notice')->with('success', 'Registration successful! Please check your email to verify your account.');
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -3,6 +3,7 @@
|
||||
namespace App\Models;
|
||||
|
||||
// use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use Illuminate\Auth\MustVerifyEmail;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
@@ -14,7 +15,7 @@ use Carbon\Carbon;
|
||||
class User extends Authenticatable
|
||||
{
|
||||
/** @use HasFactory<\Database\Factories\UserFactory> */
|
||||
use HasFactory, Notifiable;
|
||||
use HasFactory, Notifiable, MustVerifyEmail;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
|
||||
Reference in new issue
Block a user