Deassosiate all facebook, Google And Twitter accounts


  • Swedes

    Need some help here @julian and @psychobunny!
    Is there any easy way to Deassosiate all SSO modules. Maybe a mongoDB query I can run.

    Deassosiate all acounts with Facebook SSO, Google SSO and Twitter SSO

    It does not seam to be possible to Deassosiate someones account with the admin user.

    Google
    db.deleteObjectField('gplusid:uid', oAuthIdToDelete, next);
    db.deleteObjectField('user:' + uid, 'gplusid', next);

    Facebook
    db.deleteObjectField('fbid:uid', oAuthIdToDelete, next);
    db.deleteObjectField('user:' + uid, 'fbid', next);

    Twitter
    db.deleteObjectField('twid:uid', oAuthIdToDelete, next);
    db.deleteObjectField('user:' + data.uid, 'twid', next);

    Help with standard query needed 😉


  • Swedes

    Fixed it, Warning (Take backup before trying this).

    db.objects.update( { username:{$exists:true}}, { $unset:{twid: "", fbaccesstoken: "", fbrefreshtoken: "", fbid: "", gplusid: ""}}, {multi:true})
    
    db.objects.update( { "social:facebook:app_id":{$exists:true}}, { $unset:{"social:facebook:app_id": "", "social:facebook:secret": "", "social:twitter:key": "", "social:twitter:secret": ""}}, {multi:true})
    
    
    db.objects.remove( { _key: "fbid:uid"} )
    db.objects.remove( { _key: "twid:uid"} )
    db.objects.remove( { _key: "gplusid:uid"} )
    
    
    db.objects.remove( { _key: "settings:sso-google"} )
    db.objects.remove( { _key: "settings:sso-facebook"} )
    db.objects.remove( { _key: "settings:sso-twitter"} )
    

    Seams to work fine 😉


Log in to reply
 

Suggested Topics

  • 18
  • 19
  • 15
  • 3
  • 3
| |