Skip to content
This repository was archived by the owner on Jan 13, 2022. It is now read-only.

Commit a0508f4

Browse files
committed
Add an option to allow re-asking declined permissions
Add an option to allow re-asking declined permissions as mentioned in https://developers.facebook.com/docs/facebook-login/login-flow-for-web/v2.0#re-asking-declined-permissions
1 parent 8b86d9d commit a0508f4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Facebook/Helpers/FacebookRedirectLoginHelper.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function __construct($appId = null, $appSecret = null)
8080
*
8181
* @return string
8282
*/
83-
public function getLoginUrl($redirectUrl, $scope = array(), $version = null)
83+
public function getLoginUrl($redirectUrl, $scope = array(), $rerequest = false, $version = null)
8484
{
8585
$version = ($version ?: FacebookRequest::GRAPH_API_VERSION);
8686
$state = $this->random(16);
@@ -92,6 +92,10 @@ public function getLoginUrl($redirectUrl, $scope = array(), $version = null)
9292
'sdk' => 'php-sdk-' . FacebookRequest::VERSION,
9393
'scope' => implode(',', $scope)
9494
);
95+
96+
if ($rerequest)
97+
$params['auth_type'] = 'rerequest';
98+
9599
return 'https://www.facebook.com/' . $version . '/dialog/oauth?' .
96100
http_build_query($params, null, '&');
97101
}

0 commit comments

Comments
 (0)