Skip to content

Commit 2af8f16

Browse files
authored
Use route helper in two factor authentication form (#1276)
1 parent 11109e0 commit 2af8f16

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

stubs/inertia/resources/js/Pages/Profile/Partials/TwoFactorAuthenticationForm.vue

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ watch(twoFactorEnabled, () => {
3939
const enableTwoFactorAuthentication = () => {
4040
enabling.value = true;
4141
42-
router.post('/user/two-factor-authentication', {}, {
42+
router.post(route('two-factor.enable'), {}, {
4343
preserveScroll: true,
4444
onSuccess: () => Promise.all([
4545
showQrCode(),
@@ -54,25 +54,25 @@ const enableTwoFactorAuthentication = () => {
5454
};
5555
5656
const showQrCode = () => {
57-
return axios.get('/user/two-factor-qr-code').then(response => {
57+
return axios.get(route('two-factor.qr-code')).then(response => {
5858
qrCode.value = response.data.svg;
5959
});
6060
};
6161
6262
const showSetupKey = () => {
63-
return axios.get('/user/two-factor-secret-key').then(response => {
63+
return axios.get(route('two-factor.secret-key')).then(response => {
6464
setupKey.value = response.data.secretKey;
6565
});
6666
}
6767
6868
const showRecoveryCodes = () => {
69-
return axios.get('/user/two-factor-recovery-codes').then(response => {
69+
return axios.get(route('two-factor.recovery-codes')).then(response => {
7070
recoveryCodes.value = response.data;
7171
});
7272
};
7373
7474
const confirmTwoFactorAuthentication = () => {
75-
confirmationForm.post('/user/confirmed-two-factor-authentication', {
75+
confirmationForm.post(route('two-factor.confirm'), {
7676
errorBag: "confirmTwoFactorAuthentication",
7777
preserveScroll: true,
7878
preserveState: true,
@@ -86,14 +86,14 @@ const confirmTwoFactorAuthentication = () => {
8686
8787
const regenerateRecoveryCodes = () => {
8888
axios
89-
.post('/user/two-factor-recovery-codes')
89+
.post(route('two-factor.recovery-codes'))
9090
.then(() => showRecoveryCodes());
9191
};
9292
9393
const disableTwoFactorAuthentication = () => {
9494
disabling.value = true;
9595
96-
router.delete('/user/two-factor-authentication', {
96+
router.delete(route('two-factor.disable'), {
9797
preserveScroll: true,
9898
onSuccess: () => {
9999
disabling.value = false;

0 commit comments

Comments
 (0)