From 43ac9537c55c980075b9d97473b21e74fe1bc220 Mon Sep 17 00:00:00 2001 From: Matthew R Date: Fri, 18 Dec 2020 19:49:11 -0500 Subject: [PATCH] add userinfo endpoint --- src/cscli/userInfo.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cscli/userInfo.ts b/src/cscli/userInfo.ts index 5e9dd36..6d7e6ae 100644 --- a/src/cscli/userInfo.ts +++ b/src/cscli/userInfo.ts @@ -7,7 +7,7 @@ export default class UserInfo extends TCPHandler { } public async handle(ctx: Context) { - const account = await ctx.client.db.Account.findOne({ username: ctx.data.username }); - return ctx.send(account.toJSON()); + const account = await ctx.client.db.Account.findOne({ username: ctx.data.username }).lean().exec(); + return ctx.send(JSON.stringify(account)); } }