Passed
Pull Request — master (#14)
by ARCANEDEV
08:28
created
src/Fortify/Actions/Authentication/Login/RedirectIfTwoFactorWasEnabled.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -97,8 +97,9 @@  discard block
 block discarded – undo
97 97
      */
98 98
     protected function shouldUseTwoFactor($user): bool
99 99
     {
100
-        if ( ! Auth::isTwoFactorEnabled())
101
-            return false;
100
+        if ( ! Auth::isTwoFactorEnabled()) {
101
+                    return false;
102
+        }
102 103
 
103 104
         return optional($user)->isTwoFactorEnabled()
104 105
             && in_array(HasTwoFactorAuthentication::class, class_uses_recursive($user));
@@ -140,8 +141,9 @@  discard block
 block discarded – undo
140 141
      */
141 142
     protected function twoFactorChallengeResponse(Request $request, $user)
142 143
     {
143
-        if ($request->wantsJson())
144
-            return new JsonResponse(['two_factor' => true]);
144
+        if ($request->wantsJson()) {
145
+                    return new JsonResponse(['two_factor' => true]);
146
+        }
145 147
 
146 148
         return redirect()->to($this->getTwoFactorUrl($request));
147 149
     }
Please login to merge, or discard this patch.
src/Auth/Models/TwoFactor.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -151,8 +151,9 @@
 block discarded – undo
151 151
     public function getValidRecoveryCode(string $code)
152 152
     {
153 153
         foreach ($this->decrypted_recovery_codes as $recoveryCode) {
154
-            if (hash_equals($code, $recoveryCode))
155
-                return $recoveryCode;
154
+            if (hash_equals($code, $recoveryCode)) {
155
+                            return $recoveryCode;
156
+            }
156 157
         }
157 158
 
158 159
         return null;
Please login to merge, or discard this patch.