|
|
|
@ -294,7 +294,7 @@ class UserDetailHandler extends Handler {
|
|
|
|
|
const isSelfProfile = this.user._id === uid;
|
|
|
|
|
const [udoc, sdoc, union] = await Promise.all([
|
|
|
|
|
user.getById(domainId, uid),
|
|
|
|
|
token.getMostRecentSessionByUid(uid),
|
|
|
|
|
token.getMostRecentSessionByUid(uid, ['createAt', 'updateAt']),
|
|
|
|
|
domain.getUnion(domainId),
|
|
|
|
|
]);
|
|
|
|
|
if (!udoc) throw new UserNotFoundError(uid);
|
|
|
|
@ -319,12 +319,6 @@ class UserDetailHandler extends Handler {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const tags = Object.entries(acInfo).sort((a, b) => b[1] - a[1]).slice(0, 20);
|
|
|
|
|
// Remove sensitive data
|
|
|
|
|
if (!isSelfProfile && sdoc) {
|
|
|
|
|
sdoc.createIp = '';
|
|
|
|
|
sdoc.updateIp = '';
|
|
|
|
|
sdoc._id = '';
|
|
|
|
|
}
|
|
|
|
|
this.response.template = 'user_detail.html';
|
|
|
|
|
this.response.body = {
|
|
|
|
|
isSelfProfile, udoc, sdoc, pdocs, tags,
|
|
|
|
|