2024-07-19 02:28:05 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Controller;
|
|
|
|
|
|
2024-07-22 02:17:42 +02:00
|
|
|
use KnpU\OAuth2ClientBundle\Client\ClientRegistry;
|
2024-07-19 02:28:05 +02:00
|
|
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
|
|
|
|
use Symfony\Component\HttpFoundation\Response;
|
|
|
|
|
use Symfony\Component\Routing\Attribute\Route;
|
|
|
|
|
|
|
|
|
|
class HomeController extends AbstractController
|
|
|
|
|
{
|
|
|
|
|
|
2024-07-22 14:45:21 +02:00
|
|
|
#[Route(path: "/", name: "index")]
|
|
|
|
|
public function index(): Response
|
|
|
|
|
{
|
|
|
|
|
return $this->render('base.html.twig');
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-22 13:39:45 +02:00
|
|
|
#[Route(path: "/login/oauth", name: "oauth_connect")]
|
2024-07-22 02:17:42 +02:00
|
|
|
public function connectAction(ClientRegistry $clientRegistry): Response
|
|
|
|
|
{
|
|
|
|
|
return $clientRegistry->getClient('oauth')->redirect();
|
|
|
|
|
}
|
2024-07-22 13:39:45 +02:00
|
|
|
}
|