vendor/nellapp/sdk-bundle/src/Auth/Controller/Security/ConnectAction.php line 36

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the nellapp-core package.
  4.  *
  5.  * (c) Benjamin Georgeault
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. namespace Nellapp\Bundle\SDKBundle\Auth\Controller\Security;
  11. use KnpU\OAuth2ClientBundle\Client\ClientRegistry;
  12. use Symfony\Component\HttpFoundation\Response;
  13. use Symfony\Component\Routing\Annotation\Route;
  14. /**
  15.  * Class ConnectAction
  16.  *
  17.  * @author Benjamin Georgeault
  18.  */
  19. class ConnectAction
  20. {
  21.     const ROUTE_NAME 'nellapp_sdk_connect_nellapp';
  22.     public function __construct(
  23.         private ClientRegistry $clientRegistry,
  24.     ) {
  25.     }
  26.     #[Route('/login'nameself::ROUTE_NAME)]
  27.     public function __invoke(): Response
  28.     {
  29.         return $this->clientRegistry
  30.             ->getClient('nellapp')
  31.             ->redirect([], [])
  32.         ;
  33.     }
  34. }