Skip to content
Email verification (Laravel) 403 Invalid Signature
agentaldo
OP

2 years ago

I have my Laravel app working correctly except for the email verifier when a user registers it sends an email with the verification link like the following

https://my-domain.com/verify-email/1/661b90ddc6789cc36c41e7db16e25a717fcf23fc?expires=1626719702&signature=33g6c06b3e6c0da8a492250749be77de062e36ba3f14b73ffbc5866e30de2238

but when accessing the link it generates error 403 Invalid Signature

I have already verified the environment variables, and everything seems to be fine, in my local environment it works perfectly.

Does anyone know why it doesn't work?

Closed

11 Replies

agustina-ledesma

2 years ago

Hi did you find the solution? I have the same problem.


agentaldo
OP

2 years ago

Hello,

The first thing I did was to verify that in the .env file the APP_URL variable is correctly defined with https

APP_URL="https://my-domian.com"

and that this URL is the same as the one that is arriving in the verification email

Second, the use of https must be forced in the AppServiceProvider file boot() method you must have the following

if ($this->app->environment('production')) {

URL::forceScheme('https');

}


agentaldo

Hello, The first thing I did was to verify that in the .env file the APP\_URL variable is correctly defined with https `APP_URL="https://my-domian.com"` and that this URL is the same as the one that is arriving in the verification email Second, the use of https must be forced in the AppServiceProvider file boot() method you must have the following `if ($this->app->environment('production')) {` ` URL::forceScheme('https');` `}`

agustina-ledesma

2 years ago

Hello, yes I have tried it, also with: protected $proxies = '*'; but I still have the same error. I don't know what it could be. Thanks 😀


agustina-ledesma

Hello, yes I have tried it, also with: protected $proxies = '\*'; but I still have the same error. I don't know what it could be. Thanks 😀

agentaldo
OP

2 years ago

You have also verified that the time zone is correct, this may be affected by the expiration time generated by the email verification token.


agentaldo

You have also verified that the time zone is correct, this may be affected by the expiration time generated by the email verification token.

agustina-ledesma

2 years ago

Do you mean the region in settings?


agustina-ledesma

Do you mean the region in settings?

agentaldo
OP

2 years ago

Yes, if the server time is out of date, the URL may expire prematurely. Check the time on the server and the environment variable

APP_TIMEZONE


agentaldo

Yes, if the server time is out of date, the URL may expire prematurely. Check the time on the server and the environment variable `APP_TIMEZONE`

agustina-ledesma

2 years ago

yes I also checked, sadly it doesn't work for me. I still get a 403 error :(


agustina-ledesma

yes I also checked, sadly it doesn't work for me. I still get a 403 error :(

agentaldo
OP

2 years ago

At the time I had that error, those were the things I checked to fix it, if you want us to check to try to find the problem you can write to me at this email [email protected]


agentaldo

At the time I had that error, those were the things I checked to fix it, if you want us to check to try to find the problem you can write to me at this email [[email protected]](mailto:[email protected])

agustina-ledesma

2 years ago

gracias !! <3


agustina-ledesma

gracias !! <3

agentaldo
OP

2 years ago

What version of Laravel do you have?

Oh by the way, can you share your bootstrap/app.php file here so we can see how you have it configured, and?


agustina-ledesma

2 years ago

I added HTTPS true, in addition to forcing the url, and it seems to work fine.

if (env('APP_ENV') === 'production') {

URL::forceScheme('https');

$this->app['request']->server->set('HTTPS', true) ///here ;

}


Status changed to Closed brody • almost 2 years ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...