Skip to content

Commit

Permalink
fix!: use POST instead of DELETE when disabling 2FA
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Penner <[email protected]>
  • Loading branch information
matthewpi committed Oct 24, 2024
1 parent 8ca0989 commit 8be2b89
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions resources/scripts/api/account/disableAccountTwoFactor.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import http from '@/api/http';

export default (password: string): Promise<void> => {
function disableAccountTwoFactor(password: string): Promise<void> {
return new Promise((resolve, reject) => {
http.delete('/api/client/account/two-factor', { params: { password } })
http.post('/api/client/account/two-factor/disable', { password })
.then(() => resolve())
.catch(reject);
});
};
}

export default disableAccountTwoFactor;
2 changes: 1 addition & 1 deletion routes/api-client.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
Route::get('/', [Client\AccountController::class, 'index'])->name('api:client.account');
Route::get('/two-factor', [Client\TwoFactorController::class, 'index']);
Route::post('/two-factor', [Client\TwoFactorController::class, 'store']);
Route::delete('/two-factor', [Client\TwoFactorController::class, 'delete']);
Route::post('/two-factor/disable', [Client\TwoFactorController::class, 'delete']);
});

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

0 comments on commit 8be2b89

Please sign in to comment.