Laravel email verification link returns 403 Invalid signature
403 response on the verification linkShort answer
Laravel signs the full URL, including scheme and host. If the URL it rebuilds on the incoming request differs from the one it signed, the check fails with 403. Behind a proxy that is usually http versus https. Check the scheme first, then the host, then whether the link expired or was altered.
Fix it fast
1Find out which cause you have
Compare the link in the email with the URL Laravel thinks it received. Log both on the verification route.
// temporary, on the verification route logger()->info('verify', [ 'full_url' => request()->fullUrl(), 'secure' => request()->isSecure(), ]);2Match what you see, then jump to its fix
- 1
The link in the email starts with https, but full_url in the log starts with httpBehind a load balancer, the app sees http while the link is httpsFix - 2
The email link host (APP_URL, a queue worker, localhost) is not the domain the user opensThe host in the link differs from the host serving the requestFix - 3
The link is old, or an email scanner or editor altered the query stringThe link expired or the URL was changedFix
- 1
What does the error look like?
403 response on the verification linkIlluminate\Routing\Exceptions\InvalidSignatureException
Cause 1 of 3
Behind a load balancer, the app sees http while the link is https
1Check
Laravel docs say behind a TLS-terminating load balancer the app can fail to generate https links. The signature is calculated on the URL the app sees.
php artisan tinker # then run: url('/')2Fix
Trust your proxy so the scheme from the forwarded headers is used.
// bootstrap/app.php
->withMiddleware(function (Middleware $middleware): void {
$middleware->trustProxies(at: '*');
})3Verify
Send a new verification email and open the link.
php artisan optimize:clearConfirmed by laravel.com
Cause 2 of 3
The host in the link differs from the host serving the request
1Check
By default the domain is part of the signed hash, so a link built for one host fails on another. Read APP_URL in the environment that sends the mail.
grep APP_URL .env2Fix
Set APP_URL to the public address, clear the config cache, and resend. If you really sign without the domain, add the relative option to the middleware.
php artisan config:clear
// only if links were made with absolute: false
Route::get('/x/{id}', ...)->middleware('signed:relative');3Verify
Resend the email and confirm the link host is the public domain.
php artisan tinker # then run: route('verification.notice')Confirmed by laravel.com
Cause 3 of 3
The link expired or the URL was changed
1Check
Temporary signed URLs carry an expiry timestamp that is checked on every request, and the signature proves the URL was not modified. A missing or edited part gives a 403.
php artisan route:list --name=verification2Fix
Resend the verification email from the notice page and open the fresh link as received. Show a friendly page for the exception.
use Illuminate\Routing\Exceptions\InvalidSignatureException;
->withExceptions(function (Exceptions $exceptions): void {
$exceptions->render(function (InvalidSignatureException $e) {
return response()->view('errors.link-expired', status: 403);
});
})3Verify
Open an old link and confirm the custom page shows; open a new link and confirm verification works.
php artisan test --filter=EmailVerificationConfirmed by laravel.com
How do I stop it coming back?
- Set trusted proxies and APP_URL in every environment before sending real mail.
- Test the verification email on staging behind the same proxy as production.
- Offer a resend button on the verification notice page.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
Related fixes
Back end
Composer says the gd extension is missing on a Laravel project
composer install or composer update stops on a package that requires ext-gd
Composer refuses to install a package that requires ext-gd when the PHP binary running Composer has no GD extension.
4 causes, each with a fixBack end
composer require maatwebsite/excel fails to install
Composer says the package needs an older PHP than the one installed
Composer refuses maatwebsite/excel when the PHP version or a PHP extension does not match what the package and PhpSpreadsheet need.
3 causes, each with a fixBack end
composer install says the lock file is not compatible and asks for update
Your lock file does not contain a compatible set of packages. Please run composer update.
composer install checked the locked packages against this machine's PHP and extensions and found a conflict.
3 causes, each with a fixBack end
composer require laravel/horizon fails: ext-pcntl is missing
laravel/horizon v1.1.0 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system
Horizon needs the pcntl extension, and Composer refuses to install it where PHP lacks that extension.
3 causes, each with a fixBack end
composer require laravel/passport stops with 'requirements could not be resolved'
... but these were not loaded, likely because it conflicts with another require.
Composer found no Passport release that fits your project at once.
4 causes, each with a fixBack end
Composer says the root composer.json requires a PHP version your PHP does not satisfy
Your requirements could not be resolved to an installable set of packages.
Composer compares the php constraint in your composer.json, or in a package, with the PHP that runs Composer.
3 causes, each with a fix