Skip to content

Commit

Permalink
Update FacebookRedirectLoginHelper.php
Browse files Browse the repository at this point in the history
  • Loading branch information
yguedidi committed Feb 3, 2015
1 parent 66da9e0 commit f93c139
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Facebook/FacebookRedirectLoginHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,12 @@ public function __construct($redirectUrl, $appId = null, $appSecret = null)
* @param array $scope List of permissions to request during login
* @param string $version Optional Graph API version if not default (v2.0)
* @param boolean $displayAsPopup Indicate if the page will be displayed as a popup
* @param bool|string $authType 'reauthenticate' or 'https', true is equivalent to 'reauthenticate',
* false or invalid value will not add auth type parameter
*
* @return string
*/
public function getLoginUrl($scope = array(), $version = null, $displayAsPopup = false, $reauthenticate = false)
public function getLoginUrl($scope = array(), $version = null, $displayAsPopup = false, $authType = false)
{
$version = ($version ?: FacebookRequest::GRAPH_API_VERSION);
$this->state = $this->random(16);
Expand All @@ -101,7 +103,7 @@ public function getLoginUrl($scope = array(), $version = null, $displayAsPopup =
'scope' => implode(',', $scope)
);

if (!empty($reauthenticate)) {
if (in_array($authType, array(true, 'reauthenticate', 'https'))) {
$params['auth_type'] = $reauthenticate === true ? 'reauthenticate' : $reauthenticate;
}

Expand Down

0 comments on commit f93c139

Please sign in to comment.