2
votes

I've been trying to figure this out for awhile. I've gotten both FOSUserBundle and FOSFacebookBundle to work together, but I didn't realize the project I am working on requires that instead of Facebook having a login button, the Users must register an account then they can connect with Facebook to get profile information, friends, etc.

Now I am just curious if I should still be using the FOSFacebookBundle for this? And if so, how would I go about doing this? I've been attempting to modify the FacebookProvider to just update an account by passing in the current user that is logged in but it hasn't appeared to be working as the code below fails.

$user = $this->container->get('security.context')->getToken()->getUser();

It fails with getUser() is does not exist. When dumping the data from getToken(), it is just null.

A point in the right direction would be appreciated.

1

1 Answers

0
votes

You should revert your changes with making the user provider to be Facebook, create your own normal user provider and user entity using BaseUser as an example, and then when authenticated use FOSFacebookBundle to just update information of your account.