Skip to content

Commit 75b5908

Browse files
committed
fix!: use POST instead of DELETE when disabling 2FA
Signed-off-by: Matthew Penner <[email protected]>
1 parent 3a0b7d1 commit 75b5908

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import http from '@/api/http';
22

3-
export default (password: string): Promise<void> => {
3+
function disableAccountTwoFactor(password: string): Promise<void> {
44
return new Promise((resolve, reject) => {
5-
http.delete('/api/client/account/two-factor', { params: { password } })
5+
http.post('/api/client/account/two-factor/disable', { password })
66
.then(() => resolve())
77
.catch(reject);
88
});
9-
};
9+
}
10+
11+
export default disableAccountTwoFactor;

routes/api-client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
Route::get('/', [Client\AccountController::class, 'index'])->name('api:client.account');
2525
Route::get('/two-factor', [Client\TwoFactorController::class, 'index']);
2626
Route::post('/two-factor', [Client\TwoFactorController::class, 'store']);
27-
Route::delete('/two-factor', [Client\TwoFactorController::class, 'delete']);
27+
Route::post('/two-factor/disable', [Client\TwoFactorController::class, 'delete']);
2828
});
2929

3030
Route::put('/email', [Client\AccountController::class, 'updateEmail'])->name('api:client.account.update-email');

0 commit comments

Comments
 (0)