Newscoop\GimmeBundle\EventListener\OAuthEventListener::onPostAuthorizationProcess PHP Method

onPostAuthorizationProcess() public method

public onPostAuthorizationProcess ( FOS\OAuthServerBundle\Event\OAuthEvent $event )
$event FOS\OAuthServerBundle\Event\OAuthEvent
    public function onPostAuthorizationProcess(OAuthEvent $event)
    {
        if ($event->isAuthorizedClient()) {
            if (null !== ($client = $event->getClient())) {
                $user = $this->getUser($event);
                $user->addClient($client);
                $client->addUser($user);
                $this->em->persist($user);
                $this->em->persist($client);
                $this->em->flush();
            }
        }
    }