I've setup two routes
Route::get('/bugreport', 'SomeController@create')
->middleware('signed')
->name('bugreport');
Route::get('/getlink', function() {
return dd(\URL::signedRoute('bugreport', ['data' => 3]));
});
When APP_ENV=local
I can visit /getlink
then hit the resulting url and have it show. When APP_ENV=production
(the actual physical environment has not changed when changing the variable) this no longer works... stating invalid signature. Any suggestions?
UPDATE:
We do have... which might be part of it
class AppServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
if (!config('app.is_local')) {
URL::forceScheme('https');
}
}
Note: removing the above code actually does fix this issue, but then it breaks e.g. login... so either need to understand why, or this isn't an option :(.
Update Update:
The environment is heroku and the .htaccess has (as per https://help.heroku.com/J2R1S4T8/can-heroku-force-an-application-to-use-ssl-tls)
#### FORCE SSL
## see - https://help.heroku.com/J2R1S4T8/can-heroku-force-an-application-to-use-ssl-tls
RewriteCond %{HTTP_HOST} !=localhost
# If we receive a forwarded http request from a proxy...
RewriteCond %{HTTP:X-Forwarded-Proto} =http [OR]
# ...or just a plain old http request directly from the client
RewriteCond %{HTTP:X-Forwarded-Proto} =""
RewriteCond %{HTTPS} !=on
# Redirect to https version
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
### End Force SSL