Skip to content

Instantly share code, notes, and snippets.

@ahilles107
Created August 9, 2011 10:02
Show Gist options
  • Save ahilles107/1133699 to your computer and use it in GitHub Desktop.
Save ahilles107/1133699 to your computer and use it in GitHub Desktop.
/**
* {@inheritdoc}
*/
public function start(Request $request, AuthenticationException $authException = null)
{
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'), $request->getUriForPath($this->options->get('check_path', '')));
} else {
$redirect_uri = $request->getUriForPath($this->options->get('check_path', ''));
}
$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);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment