<?php
/*
* This file is part of the nellapp-core package.
*
* (c) Benjamin Georgeault
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Nellapp\Bundle\SDKBundle\Auth\Controller\Security;
use KnpU\OAuth2ClientBundle\Client\ClientRegistry;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
/**
* Class ConnectAction
*
* @author Benjamin Georgeault
*/
class ConnectAction
{
const ROUTE_NAME = 'nellapp_sdk_connect_nellapp';
public function __construct(
private ClientRegistry $clientRegistry,
) {
}
#[Route('/login', name: self::ROUTE_NAME)]
public function __invoke(): Response
{
return $this->clientRegistry
->getClient('nellapp')
->redirect([], [])
;
}
}