summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-10-16 08:54:36 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-10-16 08:54:36 +0900
commit99da4f9839e49c339624e16390a487ed102e96c2 (patch)
treeb29711378cc130509ac1bd7b847138d96e77421d /src
parentRefactor (diff)
downloadsharkey-99da4f9839e49c339624e16390a487ed102e96c2.tar.gz
sharkey-99da4f9839e49c339624e16390a487ed102e96c2.tar.bz2
sharkey-99da4f9839e49c339624e16390a487ed102e96c2.zip
Add some tests and some fixes
Diffstat (limited to 'src')
-rw-r--r--src/server/api/endpoints/i/update.ts2
-rw-r--r--src/server/api/private/signup.ts10
2 files changed, 9 insertions, 3 deletions
diff --git a/src/server/api/endpoints/i/update.ts b/src/server/api/endpoints/i/update.ts
index 77825a4aaa..7b8431f0ee 100644
--- a/src/server/api/endpoints/i/update.ts
+++ b/src/server/api/endpoints/i/update.ts
@@ -101,7 +101,7 @@ export const meta = {
export default async (params: any, user: ILocalUser, app: IApp) => new Promise(async (res, rej) => {
const [ps, psErr] = getParams(meta, params);
- if (psErr) throw psErr;
+ if (psErr) return rej(psErr);
const isSecure = user != null && app == null;
diff --git a/src/server/api/private/signup.ts b/src/server/api/private/signup.ts
index e3e8f044b5..13ca16eb9f 100644
--- a/src/server/api/private/signup.ts
+++ b/src/server/api/private/signup.ts
@@ -132,6 +132,12 @@ export default async (ctx: Koa.Context) => {
updateUserStats(account, true);
- // Response
- ctx.body = await pack(account);
+ const res = await pack(account, account, {
+ detail: true,
+ includeSecrets: true
+ });
+
+ res.token = secret;
+
+ ctx.body = res;
};