1

I have a problem with Laravel 5.7.22, I tried to activate the verification with the email and I get the message that:

A fresh verification link has been sent to your email address.

how it's properly working at least the part that send the emails with the verification link but when I click the generated link I get the following page:

I have tried to erase the project and reinstall it, and I also tried to generate the signature key with this command:

php artisan key:generate

that I have found in this other question, but that didn't work, I don't know what could be causing this issue.

I also tried to debug the the function hasValidSignature in the file UrlGenerator from Laravel, just because I read that it could help, but it doesn't make sense, I haven't event altered the middleware or something I'm just with the laravel routes that it generates by default.

The generated link looks something like this.

https://www.example.com/email/verify/1?expires=1548527438&signature=daebab97afbb2da6a0f37615bc3db7e59db9c59e704d185addcf88adf46e8f6d

I also have configured my .env file properly and the files under the config folder just for security.

Kenny Horna
  • 13,485
  • 4
  • 44
  • 71
  • Lot's of questions. First, why are you in production mode? You would be given a stack trace instead of the 403 error page which may provide you with better insight as to the error. Second, have you checked the password resets table confirm that this password reset signature is present in the table? Third, what does properly configured .env and config for security? Are you only having this issue in production and not in your testing environment? What steps did you take to properly configure your .env and config files? – Azeame Jan 26 '19 at 22:14
  • It isn't the configuration for the reset password, instead this https://laravel.com/docs/5.7/verification I followed that, and in my testing enviroment is working well. I just configured the .env files and config files in producton mode in the way I'm able to receive emails and make a connection with my database properly. And I have also the debug mode enabled, but it just shows errors for other cases, but in this particular error it just doesn't show any stack trace, which I don't know why. – Yuen Steven Jan 26 '19 at 22:30
  • Check [this](https://stackoverflow.com/questions/53892356/laravel-5-7-signed-route-returns-403-invalid-signature). – Kenny Horna Jan 26 '19 at 22:34
  • I agree, it may definitely be because you are already logged in to a particular user, when you are trying to verify an email. Make sure you are complete logged out before you verify an email address. – Azeame Jan 26 '19 at 22:36
  • I have checked that post already and yep I have already tried to log out before make the verification but if i visit that link i get the error – Yuen Steven Jan 26 '19 at 23:41
  • The post that @HCK is sharing is the one from which i tried to verify the urlGenerator but the url is clean because I hadn't added any custom middleware I just have the "laravel template" – Yuen Steven Jan 26 '19 at 23:43
  • It's done! I erased the old project and I made a new one, so I generated the key with php artisan key:generate and then i configured the .env file properly (to connect it to my database, and the email host) . – Yuen Steven Jan 27 '19 at 00:13
  • Finally I just run this command to clear the older configurations php artisan config:clear and now it's working properly. – Yuen Steven Jan 27 '19 at 00:14

0 Answers0