1
1
mirror of https://github.com/pterodactyl/panel.git synced 2024-11-22 00:52:43 +01:00

fix!: use POST instead of DELETE when disabling 2FA

Signed-off-by: Matthew Penner <me@matthewp.io>
This commit is contained in:
Matthew Penner 2024-10-24 11:27:42 -06:00
parent 8ca098940a
commit 8be2b892c3
No known key found for this signature in database
2 changed files with 6 additions and 4 deletions

View File

@ -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;

View File

@ -24,7 +24,7 @@ Route::prefix('/account')->middleware(AccountSubject::class)->group(function ()
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');