for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Controller;
use Google_Service_Gmail;
use KnpU\OAuth2ClientBundle\Client\ClientRegistry;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\Routing\Annotation\Route;
class GoogleController extends AbstractController
{
#[Route("/connect/google", name: "connect_google_start")]
public function connectAction(ClientRegistry $clientRegistry): RedirectResponse
return $clientRegistry->getClient('google')->redirect([Google_Service_Gmail::GMAIL_READONLY], []);
}
#[Route("/connect/google/check", name: "connect_google_check")]
public function connectCheckAction(): void