lib/routes/social/pinterest.js
function _linkSocialAccount(){
    return BB.bind(this)
            .then(_loadUserFromToken)
            .then(_getUserSocialDetails)
            .then(_linkIdentity)
            .catch(function(){

                return _createSocialAccount.call(this); // Could not link account. Create one instead.
            });
}
function _linkSocialAccount(){
    return BB.bind(this)
            .then(_loadUserFromToken)
            .then(_getUserSocialDetails)
            .then(_linkIdentity)
            .catch(function(){

                return _createSocialAccount.call(this); // Could not link account. Create one instead.
            });
}
function _linkSocialAccount ( ) { return BB . bind ( this ) . then ( _loadUserFromToken ) . then ( _getUserSocialDetails ) . then ( _linkIdentity ) . catch ( function ( ) { return _createSocialAccount . call ( this ) ; // Could not link account. Create one instead. } ) ; }
Function will link an existing account loading the current user from their token. We first load the user from token, then link identities. If there is an issue, we try to create the user.
Function will link an existing account loading the current user from their token . We first load the user from token then link identities . If there is an issue we try to create the user .