From 0ad558d40c832206c347030b9c6255ba634bbc88 Mon Sep 17 00:00:00 2001 From: Satsuki Yanagi <17376330+u1-liquid@users.noreply.github.com> Date: Thu, 18 Jul 2019 00:00:03 +0900 Subject: [PATCH] Resolve #5117 (#5171) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Resolve #5117 * 出来立てのユーザーがストリームコネクションを持ってるはずがない --- src/server/api/private/signup.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/server/api/private/signup.ts b/src/server/api/private/signup.ts index ac99ea0d3..026fe7485 100644 --- a/src/server/api/private/signup.ts +++ b/src/server/api/private/signup.ts @@ -5,7 +5,7 @@ import generateUserToken from '../common/generate-native-user-token'; import config from '../../../config'; import { fetchMeta } from '../../../misc/fetch-meta'; import * as recaptcha from 'recaptcha-promise'; -import { Users, RegistrationTickets } from '../../../models'; +import { Users, Signins, RegistrationTickets } from '../../../models'; import { genId } from '../../../misc/gen-id'; import { usersChart } from '../../../services/chart'; import { User } from '../../../models/entities/user'; @@ -137,6 +137,16 @@ export default async (ctx: Koa.BaseContext) => { usersChart.update(account, true); + // Append signin history + await Signins.save({ + id: genId(), + createdAt: new Date(), + userId: account.id, + ip: ctx.ip, + headers: ctx.headers, + success: true + }); + const res = await Users.pack(account, account, { detail: true, includeSecrets: true