lib/security/providers/twitter.js
function _setUserInfoFromSocialAccount(){
    return db.users.socialAuthentication('twitter', this.socialUserInfo.id_str)
            .then(function(user){
                this.userInfo = user;
            }.bind(this))
            .catch(function(err){ // If user isn't found surpress error. If found and still error then throw.
                if(err.code !== 404){
                    throw(err);
                }
            });
}
function _setUserInfoFromSocialAccount(){
    return db.users.socialAuthentication('twitter', this.socialUserInfo.id_str)
            .then(function(user){
                this.userInfo = user;
            }.bind(this))
            .catch(function(err){ // If user isn't found surpress error. If found and still error then throw.
                if(err.code !== 404){
                    throw(err);
                }
            });
}
function _setUserInfoFromSocialAccount ( ) { return db . users . socialAuthentication ( 'twitter' , this . socialUserInfo . id_str ) . then ( function ( user ) { this . userInfo = user ; } . bind ( this ) ) . catch ( function ( err ) { // If user isn't found surpress error. If found and still error then throw. if ( err . code !== 404 ) { throw ( err ) ; } } ) ; }
Function will look up a user by their social id and then assign it to the userInfo object
Function will look up a user by their social id and then assign it to the userInfo object