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.
|
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)
|
## v0.7.0 (Derelict Dermodactylus)
|
||||||
### Fixed
|
### Fixed
|
||||||
* `[rc.2]` — Fixes bad API behavior on `/user` routes.
|
* `[rc.2]` — Fixes bad API behavior on `/user` routes.
|
||||||
|
|
|
@ -107,7 +107,7 @@ class SecurityController extends Controller
|
||||||
public function setTotp(Request $request)
|
public function setTotp(Request $request)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$this->toggleTwoFactorService->handle($request->user(), $request->input('token'));
|
$this->toggleTwoFactorService->handle($request->user(), $request->input('token') ?? '');
|
||||||
|
|
||||||
return response('true');
|
return response('true');
|
||||||
} catch (TwoFactorAuthenticationTokenInvalid $exception) {
|
} catch (TwoFactorAuthenticationTokenInvalid $exception) {
|
||||||
|
@ -127,7 +127,7 @@ class SecurityController extends Controller
|
||||||
public function disableTotp(Request $request)
|
public function disableTotp(Request $request)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$this->toggleTwoFactorService->handle($request->user(), $request->input('token'), false);
|
$this->toggleTwoFactorService->handle($request->user(), $request->input('token') ?? '', false);
|
||||||
} catch (TwoFactorAuthenticationTokenInvalid $exception) {
|
} catch (TwoFactorAuthenticationTokenInvalid $exception) {
|
||||||
$this->alert->danger(trans('base.security.2fa_disable_error'))->flash();
|
$this->alert->danger(trans('base.security.2fa_disable_error'))->flash();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue