Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Fix to issue with Twitter Authentication #32

Open
levofski opened this issue Jun 25, 2012 · 0 comments
Open

Fix to issue with Twitter Authentication #32

levofski opened this issue Jun 25, 2012 · 0 comments

Comments

@levofski
Copy link

Hi there, I installed FOSTwitterBundle 1.0 and integrated with FOSFacebookBundle and FOSUserBundle.

I had an issue when authenticating with Twitter :-

"there is no provider for 'Acme\MyUserBundle\Entity\User'"

I have done lots of debugging and found that the issue was that the twitterID was not being serialized with the User when the Token was serialized. I fixed the problem using the same method as FOSFacebookBundle used, you must make sure that you have a serialize() and unserialize() function which preserves the twitterID :-

public function serialize()
{
    return serialize(array($this->facebookId, $this->twitterID, parent::serialize()));
}

public function unserialize($data)
{
    list($this->facebookId, $this->twitterID, $parentData) = unserialize($data);
    parent::unserialize($parentData);
}

Hope this helps someone!

Thanks for the bundles :-)

Lev

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant