Created
August 15, 2017 15:15
-
-
Save ovr/f123028ae5d6feea79f1b7b2f7052991 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class OauthController extends AbstractController | |
{ | |
/** | |
* @Inject("SocialConnect\Auth\Service") | |
* | |
* @var \SocialConnect\Auth\Service | |
*/ | |
protected $oauth; | |
public function getAction() | |
{ | |
$id = $this->request->attributes->get('id'); | |
if ($id) { | |
throw new InvalidParameterException('id'); | |
} | |
// Get provider by id | |
$provider = $this->oauth->getProvider($id); | |
return new RedirectResponse($provider->makeAuthUrl()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment