mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-04-24 03:59:08 -05:00
refactor: adopt if helpers
- Collapse multiline if statements by adopting Laravel’s abort_if and throw_if helpers.
This commit is contained in:
@@ -92,9 +92,7 @@ class TwoStepController extends Controller
|
||||
*/
|
||||
public function showVerification(): \Illuminate\Contracts\View\View
|
||||
{
|
||||
if (! \config('auth.TwoStepEnabled')) {
|
||||
\abort(404);
|
||||
}
|
||||
abort_if(! \config('auth.TwoStepEnabled'), \404);
|
||||
|
||||
$twoStepAuth = $this->twoStepAuth;
|
||||
$authStatus = $this->authStatus;
|
||||
@@ -147,9 +145,7 @@ class TwoStepController extends Controller
|
||||
*/
|
||||
public function verify(Request $request): ?\Illuminate\Http\JsonResponse
|
||||
{
|
||||
if (! \config('auth.TwoStepEnabled')) {
|
||||
\abort(404);
|
||||
}
|
||||
abort_if(! \config('auth.TwoStepEnabled'), \404);
|
||||
|
||||
if ($request->ajax()) {
|
||||
$validator = \validator($request->all(), [
|
||||
@@ -192,9 +188,7 @@ class TwoStepController extends Controller
|
||||
*/
|
||||
public function resend(): \Illuminate\Http\JsonResponse
|
||||
{
|
||||
if (! \config('auth.TwoStepEnabled')) {
|
||||
\abort(404);
|
||||
}
|
||||
abort_if(! \config('auth.TwoStepEnabled'), \404);
|
||||
|
||||
$twoStepAuth = $this->twoStepAuth;
|
||||
$this->sendVerificationCodeNotification($twoStepAuth);
|
||||
|
||||
Reference in New Issue
Block a user