1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-02 15:36:06 +02:00

テーブル分割

This commit is contained in:
syuilo
2019-04-10 15:04:27 +09:00
parent 9603f3fa4f
commit 626cfb61ac
33 changed files with 267 additions and 232 deletions

View File

@@ -4,7 +4,7 @@ import * as speakeasy from 'speakeasy';
import * as QRCode from 'qrcode';
import config from '../../../../../config';
import define from '../../../define';
import { Users } from '../../../../../models';
import { UserProfiles } from '../../../../../models';
export const meta = {
requireCredential: true,
@@ -19,8 +19,10 @@ export const meta = {
};
export default define(meta, async (ps, user) => {
const profile = await UserProfiles.findOne({ userId: user.id });
// Compare password
const same = await bcrypt.compare(ps.password, user.password);
const same = await bcrypt.compare(ps.password, profile.password);
if (!same) {
throw new Error('incorrect password');
@@ -31,7 +33,7 @@ export default define(meta, async (ps, user) => {
length: 32
});
await Users.update(user.id, {
await UserProfiles.update({ userId: user.id }, {
twoFactorTempSecret: secret.base32
});