<?php
namespace App\Controller;
use KnpU\OAuth2ClientBundle\Client\ClientRegistry;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
class OAuthController extends AbstractController
{
#[Route('/connect/google', name: 'connect_google', methods: ['POST', 'GET'])]
public function connectGoogleAction(ClientRegistry $clientRegistry)
{
return $clientRegistry
->getClient('google')
->redirect(['openid', 'email'], []);
}
#[Route('/connect/facebook', name: 'connect_facebook', methods: ['POST', 'GET'])]
public function connectFacebookAction(ClientRegistry $clientRegistry)
{
return $clientRegistry
->getClient('facebook')
->redirect(['public_profile', 'email', 'user_birthday'], []);
}
#[Route('/connect/google/check', name: 'connect_google_check', methods: ['GET', 'POST'])]
public function connectGoogleCheckAction()
{
}
#[Route('/connect/facebook/check', name: 'connect_facebook_check', methods: ['GET', 'POST'])]
public function connectFacebookCheckAction()
{
}
}