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

Commit 9154dc7

Browse files
committed
Merge pull request #341 from yguedidi/patch-1
Enhance #325
2 parents 66da9e0 + 9530e55 commit 9154dc7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Facebook/FacebookRedirectLoginHelper.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,12 @@ public function __construct($redirectUrl, $appId = null, $appSecret = null)
8585
* @param array $scope List of permissions to request during login
8686
* @param string $version Optional Graph API version if not default (v2.0)
8787
* @param boolean $displayAsPopup Indicate if the page will be displayed as a popup
88+
* @param bool|string $authType 'reauthenticate' or 'https', true is equivalent to 'reauthenticate',
89+
* false or invalid value will not add auth type parameter
8890
*
8991
* @return string
9092
*/
91-
public function getLoginUrl($scope = array(), $version = null, $displayAsPopup = false, $reauthenticate = false)
93+
public function getLoginUrl($scope = array(), $version = null, $displayAsPopup = false, $authType = false)
9294
{
9395
$version = ($version ?: FacebookRequest::GRAPH_API_VERSION);
9496
$this->state = $this->random(16);
@@ -101,7 +103,7 @@ public function getLoginUrl($scope = array(), $version = null, $displayAsPopup =
101103
'scope' => implode(',', $scope)
102104
);
103105

104-
if (!empty($reauthenticate)) {
106+
if (in_array($authType, array(true, 'reauthenticate', 'https'), true)) {
105107
$params['auth_type'] = $reauthenticate === true ? 'reauthenticate' : $reauthenticate;
106108
}
107109

0 commit comments

Comments
 (0)