From 91172654e4b715198099146d4c442e0787df0785 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 13 Feb 2021 15:33:38 +0900 Subject: refactor: resolve #7139 --- src/server/api/private/signin.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/server/api/private') diff --git a/src/server/api/private/signin.ts b/src/server/api/private/signin.ts index 734758d63d..7a5efc6cc9 100644 --- a/src/server/api/private/signin.ts +++ b/src/server/api/private/signin.ts @@ -6,7 +6,6 @@ import config from '../../../config'; import { Users, Signins, UserProfiles, UserSecurityKeys, AttestationChallenges } from '../../../models'; import { ILocalUser } from '../../../models/entities/user'; import { genId } from '../../../misc/gen-id'; -import { ensure } from '../../../prelude/ensure'; import { verifyLogin, hash } from '../2fa'; import { randomBytes } from 'crypto'; @@ -47,7 +46,7 @@ export default async (ctx: Koa.Context) => { return; } - const profile = await UserProfiles.findOne(user.id).then(ensure); + const profile = await UserProfiles.findOneOrFail(user.id); // Compare password const same = await bcrypt.compare(password, profile.password!); -- cgit v1.2.3-freya