<?php
namespace App\Controller\Front;
use KnpU\OAuth2ClientBundle\Client\ClientRegistry;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\RedirectResponse;
class SocialController extends AbstractController
{
private ClientRegistry $clientRegistry;
public function __construct(ClientRegistry $clientRegistry)
{
$this->clientRegistry = $clientRegistry;
}
public function facebookStart(): RedirectResponse
{
// will redirect to Facebook!
return $this->clientRegistry
->getClient('facebook_main')
->redirect([
'public_profile', 'email',
]);
}
public function facebookCheck()
{
}
public function googleStart(): RedirectResponse
{
// Redirect to google
return $this->clientRegistry->getClient('google')->redirect([], []);
}
public function googleCheck()
{
}
}