mirror of
https://github.com/pterodactyl/panel.git
synced 2025-12-10 00:32:14 -06:00
fix!: use POST instead of DELETE when disabling 2FA
Signed-off-by: Matthew Penner <me@matthewp.io>
This commit is contained in:
parent
8ca098940a
commit
8be2b892c3
@ -1,9 +1,11 @@
|
|||||||
import http from '@/api/http';
|
import http from '@/api/http';
|
||||||
|
|
||||||
export default (password: string): Promise<void> => {
|
function disableAccountTwoFactor(password: string): Promise<void> {
|
||||||
return new Promise((resolve, reject) => {
|
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())
|
.then(() => resolve())
|
||||||
.catch(reject);
|
.catch(reject);
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
|
||||||
|
export default disableAccountTwoFactor;
|
||||||
|
|||||||
@ -24,7 +24,7 @@ Route::prefix('/account')->middleware(AccountSubject::class)->group(function ()
|
|||||||
Route::get('/', [Client\AccountController::class, 'index'])->name('api:client.account');
|
Route::get('/', [Client\AccountController::class, 'index'])->name('api:client.account');
|
||||||
Route::get('/two-factor', [Client\TwoFactorController::class, 'index']);
|
Route::get('/two-factor', [Client\TwoFactorController::class, 'index']);
|
||||||
Route::post('/two-factor', [Client\TwoFactorController::class, 'store']);
|
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');
|
Route::put('/email', [Client\AccountController::class, 'updateEmail'])->name('api:client.account.update-email');
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user