PHP code example of lingoda / b2b-crosslogin-bundle

1. Go to this page and download the library: Download lingoda/b2b-crosslogin-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

lingoda / b2b-crosslogin-bundle example snippets


return [
    // ...
    Lingoda\CrossLoginBundle\LingodaCrossLoginBundle::class => ['all' => true],
];

#[AsEventListener(event: 'lingoda_crosslogin.my_receiver.succeeded')]
final readonly class MyCrossLoginListener
{
    public function __invoke(CrossLoginSucceededEvent $event): void
    {
        $response = new RedirectResponse($this->urlGenerator->generate('app_main'));
        foreach ($this->cookieFactory->create($event->user) as $cookie) {
            $response->headers->setCookie($cookie);
        }

        $event->setResponse($response);
    }
}