I am running Laravel 5.5 and i use the basic auth of Laravel.
I have a route called "profile-completed" and that route uses a middleware "auth" / a user must be logged in in order to see that page.
That route(uses a view) has a function which creates a "share dialog" - with the below function - of facebook. The problem is that facebook can't fetch the og:meta because the view(route) is protected and it redirects to /login
as seen through facebook sharing debugger.
Redirect Path
Input URL arrow-right https://www.url.com/profile-completed
302 HTTP Redirect arrow-right https://www.url.com/login
As we see above, it redirects to /login so it fetches the og:meta of /login page.
Facebook share function :
FB.ui({
method: 'share',
href: '{{ env('APP_URL') }}',
picture: '{{ asset('"img/share.png') }}',
}, function( response ) {
// do nothing
});
Question : How could i let facebook fetch og meta even of a page(view/route) which is protected by a middleware?
Middleware it uses :
protected $routeMiddleware = [
'auth' => \Illuminate\Auth\Middleware\Authenticate::class,