Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

lukeboy_2002's avatar

verify mail

In a new laravel site/ app with starter kit the registration is not what I expect. After registration, the user must register his email. So in My model I added MustVerifyMail. After registering, the https://{mysite}/verify-email page will be loaded. You can choose to log out or resend verification mail. The email comes in. but can only work in the open browser where you have not yet logged out. If you are logged out, the link will not work and you will go back to the login page. the email_verified_at is not entered in the database.

The routes auth.php contain the routes linked to the middleware auth.

Route::get('verify-email/{id}/{hash}', VerifyEmailController::class)->middleware(['signed', 'throttle:6,1'])->name('verification.verify');

and

Route::get('verify-email', EmailVerificationPromptController::class)->name('verification.notice');

How can I make it so that verification is possible even if the user is already logged out or is using a different browser.

1 like
4 replies
vincent15000's avatar

What you want is not the normal behavior.

If you really want this, I suggest you to generate your own temporary email verification link and handle the verification by your own in a controller.

ghabriel25's avatar

I think there was a video from Jeffrey about passwordless authentication

1 like
imrandevbd's avatar

This happens because the starter kits (Breeze/Jetstream) wrap that verification route in the auth middleware by default. When you open the link in a different browser, you're a "guest," so the middleware intercepts the request and redirects you to the login page before the verification logic even runs.

To fix this, you need to allow guests to hit that endpoint and manually find the user since $request->user() won't be available.

First, in routes/auth.php, move the route outside the auth middleware group, Then, you'll need to tweak the VerifyEmailController. Since you aren't using the auth middleware anymore,

Please or to participate in this conversation.