mirror of
https://github.com/pterodactyl/panel.git
synced 2024-11-25 18:42:31 +01:00
Fix exception when no 2FA token is entered when enabling or disabling
This commit is contained in:
parent
59cec6cd4b
commit
50809cad36
@ -3,6 +3,10 @@ This file is a running track of new features and fixes to each version of the pa
|
||||
|
||||
This project follows [Semantic Versioning](http://semver.org) guidelines.
|
||||
|
||||
## v0.7.1 (Derelict Dermodactylus)
|
||||
### Fixed
|
||||
* Fixes an exception when no token is entered on the 2-Factor enable/disable page and the form is submitted.
|
||||
|
||||
## v0.7.0 (Derelict Dermodactylus)
|
||||
### Fixed
|
||||
* `[rc.2]` — Fixes bad API behavior on `/user` routes.
|
||||
|
@ -107,7 +107,7 @@ class SecurityController extends Controller
|
||||
public function setTotp(Request $request)
|
||||
{
|
||||
try {
|
||||
$this->toggleTwoFactorService->handle($request->user(), $request->input('token'));
|
||||
$this->toggleTwoFactorService->handle($request->user(), $request->input('token') ?? '');
|
||||
|
||||
return response('true');
|
||||
} catch (TwoFactorAuthenticationTokenInvalid $exception) {
|
||||
@ -127,7 +127,7 @@ class SecurityController extends Controller
|
||||
public function disableTotp(Request $request)
|
||||
{
|
||||
try {
|
||||
$this->toggleTwoFactorService->handle($request->user(), $request->input('token'), false);
|
||||
$this->toggleTwoFactorService->handle($request->user(), $request->input('token') ?? '', false);
|
||||
} catch (TwoFactorAuthenticationTokenInvalid $exception) {
|
||||
$this->alert->danger(trans('base.security.2fa_disable_error'))->flash();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user