|
@@ -427,6 +427,16 @@ module.exports = function(crowi, app) {
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
})
|
|
})
|
|
|
|
|
+ .then((userData) => {
|
|
|
|
|
+ // remove all External Accounts
|
|
|
|
|
+ ExternalAccount.remove({user: userData})
|
|
|
|
|
+ .then((err) => {
|
|
|
|
|
+ if (err) {
|
|
|
|
|
+ throw new Error(err.message);
|
|
|
|
|
+ }
|
|
|
|
|
+ return userData;
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
.then((userData) => {
|
|
.then((userData) => {
|
|
|
return Page.removePageByPath(`/user/${username}`)
|
|
return Page.removePageByPath(`/user/${username}`)
|
|
|
.then(() => userData);
|
|
.then(() => userData);
|