Resolve conflicts

This commit is contained in:
syuilo
2018-03-29 14:48:47 +09:00
parent 281b388e39
commit bfc193d8cd
308 changed files with 3045 additions and 3200 deletions

View File

@@ -12,12 +12,12 @@ module.exports = async (params, user) => new Promise(async (res, rej) => {
const _token = token.replace(/\s/g, '');
if (user.two_factor_temp_secret == null) {
if (user.twoFactorTempSecret == null) {
return rej('二段階認証の設定が開始されていません');
}
const verified = (speakeasy as any).totp.verify({
secret: user.two_factor_temp_secret,
secret: user.twoFactorTempSecret,
encoding: 'base32',
token: _token
});
@@ -28,8 +28,8 @@ module.exports = async (params, user) => new Promise(async (res, rej) => {
await User.update(user._id, {
$set: {
'account.two_factor_secret': user.two_factor_temp_secret,
'account.two_factor_enabled': true
'account.twoFactorSecret': user.twoFactorTempSecret,
'account.twoFactorEnabled': true
}
});

View File

@@ -27,7 +27,7 @@ module.exports = async (params, user) => new Promise(async (res, rej) => {
await User.update(user._id, {
$set: {
two_factor_temp_secret: secret.base32
twoFactorTempSecret: secret.base32
}
});

View File

@@ -19,8 +19,8 @@ module.exports = async (params, user) => new Promise(async (res, rej) => {
await User.update(user._id, {
$set: {
'account.two_factor_secret': null,
'account.two_factor_enabled': false
'account.twoFactorSecret': null,
'account.twoFactorEnabled': false
}
});