mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
core: fix User.serialize (#986)
This commit is contained in:
1 parent
3a9755556e
commit
76a822c179
1 file changed
+1
-1
@@ -159,7 +159,7 @@ export class User {
|
||||
return user;
|
||||
}
|
||||
|
||||
serialize(_, h) {
|
||||
serialize(h) {
|
||||
if (!this._isPrivate) {
|
||||
const fields = ['_id', 'uname', 'mail', 'perm', 'role', 'priv', 'regat', 'loginat', 'tfa', 'authn'];
|
||||
if (h?.user?.hasPerm(PERM.PERM_VIEW_DISPLAYNAME)) fields.push('displayName');
|
||||
|
||||
Reference in new issue
Block a user