From 2af8f166436bf73c946f7187055d2df317d3e981 Mon Sep 17 00:00:00 2001 From: Sushant Aryal Date: Thu, 2 Mar 2023 01:16:53 +0545 Subject: [PATCH] Use route helper in two factor authentication form (#1276) --- .../Partials/TwoFactorAuthenticationForm.vue | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/stubs/inertia/resources/js/Pages/Profile/Partials/TwoFactorAuthenticationForm.vue b/stubs/inertia/resources/js/Pages/Profile/Partials/TwoFactorAuthenticationForm.vue index 029196296..e1f55bfa7 100644 --- a/stubs/inertia/resources/js/Pages/Profile/Partials/TwoFactorAuthenticationForm.vue +++ b/stubs/inertia/resources/js/Pages/Profile/Partials/TwoFactorAuthenticationForm.vue @@ -39,7 +39,7 @@ watch(twoFactorEnabled, () => { const enableTwoFactorAuthentication = () => { enabling.value = true; - router.post('/user/two-factor-authentication', {}, { + router.post(route('two-factor.enable'), {}, { preserveScroll: true, onSuccess: () => Promise.all([ showQrCode(), @@ -54,25 +54,25 @@ const enableTwoFactorAuthentication = () => { }; const showQrCode = () => { - return axios.get('/user/two-factor-qr-code').then(response => { + return axios.get(route('two-factor.qr-code')).then(response => { qrCode.value = response.data.svg; }); }; const showSetupKey = () => { - return axios.get('/user/two-factor-secret-key').then(response => { + return axios.get(route('two-factor.secret-key')).then(response => { setupKey.value = response.data.secretKey; }); } const showRecoveryCodes = () => { - return axios.get('/user/two-factor-recovery-codes').then(response => { + return axios.get(route('two-factor.recovery-codes')).then(response => { recoveryCodes.value = response.data; }); }; const confirmTwoFactorAuthentication = () => { - confirmationForm.post('/user/confirmed-two-factor-authentication', { + confirmationForm.post(route('two-factor.confirm'), { errorBag: "confirmTwoFactorAuthentication", preserveScroll: true, preserveState: true, @@ -86,14 +86,14 @@ const confirmTwoFactorAuthentication = () => { const regenerateRecoveryCodes = () => { axios - .post('/user/two-factor-recovery-codes') + .post(route('two-factor.recovery-codes')) .then(() => showRecoveryCodes()); }; const disableTwoFactorAuthentication = () => { disabling.value = true; - router.delete('/user/two-factor-authentication', { + router.delete(route('two-factor.disable'), { preserveScroll: true, onSuccess: () => { disabling.value = false;