symfony - HWIOAuthBundle eagerly creates users -
in app need able let users log in , connect accounts via oauth. i'm using hwioauthbundle , fosuserbundle accomplish that. there's problem: when i'm registering via facebook or whatnot user
entity automatically created , persisted database, , token created user.
what need fetch data provider gives me , map user yet persisted.
if understand, add example facebook information logged-in user.
so have in provider check there connected user , add information:
if (($this->container->get('security.context')->gettoken() instanceof abstracttoken) { $loggeduser = $this->container->get('security.context')->gettoken()->getuser(); $loggeduser->setfacebookid($fbdata['id']); /* usermanager fos_user.user_manager service */ $this->usermanager->updateuser($loggeduser); return $loggeduser; }
Comments
Post a Comment