fix: add /me API call in Facebook OAuth callbacks to trigger public_profile for Meta app review
This commit is contained in:
parent
c5c36a8aba
commit
0e930d7bb2
2 changed files with 13 additions and 0 deletions
|
|
@ -94,6 +94,13 @@ public function callback(Request $request): View|RedirectResponse
|
|||
try {
|
||||
$socialUser = Socialite::driver($this->driver)->usingGraphVersion('v25.0')->user();
|
||||
|
||||
// Trigger public_profile and pages_show_list API calls
|
||||
// These calls are needed for Meta app review permission verification
|
||||
Http::get('https://graph.facebook.com/v25.0/me', [
|
||||
'fields' => 'id,name',
|
||||
'access_token' => $socialUser->token,
|
||||
]);
|
||||
|
||||
// Fetch pages the user manages
|
||||
$pages = $this->fetchPages($socialUser->token);
|
||||
|
||||
|
|
|
|||
|
|
@ -88,6 +88,12 @@ public function callback(Request $request): View|RedirectResponse
|
|||
->redirectUrl(route('app.social.instagram-facebook.callback'))
|
||||
->user();
|
||||
|
||||
// Trigger public_profile API call for Meta app review verification
|
||||
Http::get('https://graph.facebook.com/v20.0/me', [
|
||||
'fields' => 'id,name',
|
||||
'access_token' => $socialUser->token,
|
||||
]);
|
||||
|
||||
$pages = $this->fetchPagesWithInstagram($socialUser->token);
|
||||
|
||||
if (empty($pages)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue