Haven't really faced anything similar, but I don't really use Heroku.
Might it be something particular to Heroku?
I use Laravel Forge and have email verification working on about 3 live apps right now.
I am using the latest version of Laravel 5.7 and I setup the new built in Email Verification.
When I use it locally it works fine and I'm able to verify my email address.
However, when I try to do the same flow on Heroku, I hit a 403 Error every time. Anyone else hitting this? or does anyone know what could be causing this behavior?
Thanks in advance!!
No, I have my APP_URL with "https" in it. Good idea to check there though. That could have been a cause.
I was able to finally figure it out.
It had to do with the TrustProxies middleware.
I was able to put my forceScheme HTTPS code back into the AppServiceProvider and its all working again.
I had to set my TrustProxies Middleware as follows:
protected $proxies = '*';
protected $headers = Request::HEADER_X_FORWARDED_AWS_ELB;
Since all the traffic to the Heroku server is coming from a Heroku load balancer, it wasn't looking at the request as secure. Once I updated these two lines in the middleware it started working.
Here is where I found the solution: https://devcenter.heroku.com/articles/getting-started-with-laravel
It's also documented on laravel.com too: https://laravel.com/docs/5.7/requests#configuring-trusted-proxies
It's at the very bottom/end of the post.
Thanks @wilburpowery and @Snapey for your attempts to help.
Please or to participate in this conversation.