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

Commit 879c606

Browse files
committed
Merge pull request #325 from vrcAlbert/feature/reauthentication
allow to force re-authenticate with getLoginUrl method
2 parents 676958c + 36ec0f3 commit 879c606

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Facebook/FacebookRedirectLoginHelper.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function __construct($redirectUrl, $appId = null, $appSecret = null)
8888
*
8989
* @return string
9090
*/
91-
public function getLoginUrl($scope = array(), $version = null, $displayAsPopup = false)
91+
public function getLoginUrl($scope = array(), $version = null, $displayAsPopup = false, $reauthenticate = false)
9292
{
9393
$version = ($version ?: FacebookRequest::GRAPH_API_VERSION);
9494
$this->state = $this->random(16);
@@ -100,6 +100,10 @@ public function getLoginUrl($scope = array(), $version = null, $displayAsPopup =
100100
'sdk' => 'php-sdk-' . FacebookRequest::VERSION,
101101
'scope' => implode(',', $scope)
102102
);
103+
104+
if (!empty($reauthenticate)) {
105+
$params['auth_type'] = $reauthenticate === true ? 'reauthenticate' : $reauthenticate;
106+
}
103107

104108
if ($displayAsPopup)
105109
{

0 commit comments

Comments
 (0)