Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

expose options to be able to set server_url and app_url based on request #284

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions Security/EntryPoint/FacebookAuthenticationEntryPoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,23 @@ public function start(Request $request, AuthenticationException $authException =
if ($this->options->get('server_url') && $this->options->get('app_url')) {
$redirect_uri = str_replace($this->options->get('server_url'), $this->options->get('app_url'), $redirect_uri);
}

$loginUrl = $this->facebook->getLoginUrl(
array(
'display' => $this->options->get('display', 'page'),
'scope' => implode(',', $this->permissions),
'redirect_uri' => $redirect_uri,
));

if ($this->options->get('server_url') && $this->options->get('app_url')){
return new Response('<html><head></head><body><script>top.location.href="'.$loginUrl.'";</script></body></html>');
}

return new RedirectResponse($loginUrl);
}

public function getOptions()
{
return $this->options;
}
}