Last active
December 19, 2015 07:49
-
-
Save vincenzodibiaggio/5920932 to your computer and use it in GitHub Desktop.
FriendsOfSymfony/FOSTwitterBundle - Load existing user and connect to twitter account using twitter account data after authorization
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# On documentation we can see: | |
public function findUserByTwitterId($twitterID) | |
{ | |
return $this->userManager->findUserBy(array('twitterID' => $twitterID)); | |
} | |
public function loadUserByUsername($username) | |
{ | |
$user = $this->findUserByTwitterId($username); | |
# To permit association between logged user and authorized user on twitter I have changed code: | |
public function findUserByTwitterId($username) | |
{ | |
return $this->userManager->findUserBy(array('twitter_username' => $username)); | |
} | |
# because at this moment in the workflow we manage the twitter_username instead of twitter_id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment