mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-07 06:56:04 +02:00
Display 2FA dialog once
This commit is contained in:
+31
-1
@@ -6540,7 +6540,17 @@ speechSynthesis.getVoices();
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$app.data.twoFactorAuthDialogVisible = false;
|
||||||
|
|
||||||
|
API.$on('LOGIN', function () {
|
||||||
|
$app.twoFactorAuthDialogVisible = false;
|
||||||
|
});
|
||||||
|
|
||||||
$app.methods.promptTOTP = function () {
|
$app.methods.promptTOTP = function () {
|
||||||
|
if (this.twoFactorAuthDialogVisible) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.twoFactorAuthDialogVisible = true;
|
||||||
this.$prompt($t('prompt.totp.description'), $t('prompt.totp.header'), {
|
this.$prompt($t('prompt.totp.description'), $t('prompt.totp.header'), {
|
||||||
distinguishCancelAndClose: true,
|
distinguishCancelAndClose: true,
|
||||||
cancelButtonText: $t('prompt.totp.use_otp'),
|
cancelButtonText: $t('prompt.totp.use_otp'),
|
||||||
@@ -6564,11 +6574,19 @@ speechSynthesis.getVoices();
|
|||||||
} else if (action === 'cancel') {
|
} else if (action === 'cancel') {
|
||||||
this.promptOTP();
|
this.promptOTP();
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
beforeClose: (action, instance, done) => {
|
||||||
|
this.twoFactorAuthDialogVisible = false;
|
||||||
|
done();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
$app.methods.promptOTP = function () {
|
$app.methods.promptOTP = function () {
|
||||||
|
if (this.twoFactorAuthDialogVisible) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.twoFactorAuthDialogVisible = true;
|
||||||
this.$prompt($t('prompt.otp.description'), $t('prompt.otp.header'), {
|
this.$prompt($t('prompt.otp.description'), $t('prompt.otp.header'), {
|
||||||
distinguishCancelAndClose: true,
|
distinguishCancelAndClose: true,
|
||||||
cancelButtonText: $t('prompt.otp.use_otp'),
|
cancelButtonText: $t('prompt.otp.use_otp'),
|
||||||
@@ -6592,11 +6610,19 @@ speechSynthesis.getVoices();
|
|||||||
} else if (action === 'cancel') {
|
} else if (action === 'cancel') {
|
||||||
this.promptTOTP();
|
this.promptTOTP();
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
beforeClose: (action, instance, done) => {
|
||||||
|
this.twoFactorAuthDialogVisible = false;
|
||||||
|
done();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
$app.methods.promptEmailOTP = function () {
|
$app.methods.promptEmailOTP = function () {
|
||||||
|
if (this.twoFactorAuthDialogVisible) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.twoFactorAuthDialogVisible = true;
|
||||||
this.$prompt(
|
this.$prompt(
|
||||||
$t('prompt.email_otp.description'),
|
$t('prompt.email_otp.description'),
|
||||||
$t('prompt.email_otp.header'),
|
$t('prompt.email_otp.header'),
|
||||||
@@ -6621,6 +6647,10 @@ speechSynthesis.getVoices();
|
|||||||
return args;
|
return args;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
beforeClose: (action, instance, done) => {
|
||||||
|
this.twoFactorAuthDialogVisible = false;
|
||||||
|
done();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -21955,7 +21985,7 @@ speechSynthesis.getVoices();
|
|||||||
API.$on('LOGIN', async function () {
|
API.$on('LOGIN', async function () {
|
||||||
$app.avatarHistory = new Set();
|
$app.avatarHistory = new Set();
|
||||||
var historyArray = await database.getAvatarHistory();
|
var historyArray = await database.getAvatarHistory();
|
||||||
$app.avatarHistoryArray = historyArray.reverse();
|
$app.avatarHistoryArray = historyArray;
|
||||||
for (var i = 0; i < historyArray.length; i++) {
|
for (var i = 0; i < historyArray.length; i++) {
|
||||||
$app.avatarHistory.add(historyArray[i].id);
|
$app.avatarHistory.add(historyArray[i].id);
|
||||||
this.applyAvatar(historyArray[i]);
|
this.applyAvatar(historyArray[i]);
|
||||||
|
|||||||
@@ -1583,7 +1583,7 @@ class Database {
|
|||||||
updated_at: dbRow[12],
|
updated_at: dbRow[12],
|
||||||
version: dbRow[13]
|
version: dbRow[13]
|
||||||
};
|
};
|
||||||
data.unshift(row);
|
data.push(row);
|
||||||
}, `SELECT * FROM ${Database.userPrefix}_avatar_history INNER JOIN cache_avatar ON cache_avatar.id = ${Database.userPrefix}_avatar_history.avatar_id ORDER BY ${Database.userPrefix}_avatar_history.created_at DESC LIMIT 100`);
|
}, `SELECT * FROM ${Database.userPrefix}_avatar_history INNER JOIN cache_avatar ON cache_avatar.id = ${Database.userPrefix}_avatar_history.avatar_id ORDER BY ${Database.userPrefix}_avatar_history.created_at DESC LIMIT 100`);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user