@ctrlaltdelme I don't use any starter kit, but you can do something like this.
According to me, you have to handle this frontend side.
If you configure your button handler on a 423 response to redirect to the password confirm page, you can do something simple :
-
ask to enable 2FA (click on the button)
-
423 response => then go to the password confirmation page
-
if the password is ok, retrieve the 2FA codes
You could also create a VueJS component with a confirm password modal that is triggered every time it's needed to confirm the password, with a Promise to resolve it according to the right password confirmation.
You could have a code similar to this one.
const destroy = async (item) => {
const confirmed = await modal.value.dialog();
if (confirmed) {
const res = await categoriesService.delete(item);
if (res.status === 204) {
const index = categories.value.data.findIndex(category => category.id === item.id);
if (index >= 0) {
categories.value.data.splice(index, 1);
}
}
}
}
And the modal.value.dialog() could handle the password confirmation request.