add delete user idenity and credentials after profile deletion

This commit is contained in:
Berkeley Martinez
2015-06-11 15:22:40 -07:00
parent 34c3fef7d4
commit 5be6ce7193
3 changed files with 40 additions and 145 deletions

View File

@ -4,7 +4,6 @@ var defaultProfileImage =
require('../utils/constantStrings.json').defaultProfileImage;
module.exports = function(UserIdent) {
UserIdent.observe('before save', function(ctx, next) {
var userIdent = ctx.currentInstance || ctx.instance;
if (!userIdent) {
@ -17,7 +16,6 @@ module.exports = function(UserIdent) {
debug('no user attached to identity!');
return next();
}
debug('got user', user.username);
var picture = userIdent.profile && userIdent.profile[0] ?
userIdent.profile[0].value :