Completed
Push — master ( b1d4cf...feaedb )
by LAHAXE
8s
created
src/http/Middleware/U2f.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -44,14 +44,14 @@
 block discarded – undo
44 44
      */
45 45
     public function handle($request, Closure $next)
46 46
     {
47
-        if(!$this->config->get('u2f.enable')) {
47
+        if (!$this->config->get('u2f.enable')) {
48 48
             return $next($request);
49 49
         }
50 50
 
51 51
         if (!$this->u2f->check()) {
52
-            if(!Auth::guest()){
53
-                if(
54
-                    U2fKey::where('user_id', '=', Auth::user()->getAuthIdentifier())->count()  === 0
52
+            if (!Auth::guest()) {
53
+                if (
54
+                    U2fKey::where('user_id', '=', Auth::user()->getAuthIdentifier())->count() === 0
55 55
                     && $this->config->get('u2f.byPassUserWithoutKey')
56 56
                 ) {
57 57
                     return $next($request);
Please login to merge, or discard this patch.
src/http/Controllers/U2fController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         list($req, $sigs) = $this->u2f->getRegisterData(Auth::user());
44 44
         Event::fire('u2f.register.data', [ 'user' => Auth::user() ]);
45 45
 
46
-        session(['u2f.registerData' => $req]);
46
+        session([ 'u2f.registerData' => $req ]);
47 47
 
48 48
         return view($this->config->get('u2f.register.view'))
49 49
             ->with('currentKeys', $sigs)
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
             Event::fire('u2f.register', [ 'u2fKey' => $key, 'user' => Auth::user() ]);
65 65
             session()->forget('u2f.registerData');
66 66
             
67
-            session([$this->config->get('u2f.sessionU2fName') => true]);
67
+            session([ $this->config->get('u2f.sessionU2fName') => true ]);
68 68
 
69 69
             if ($this->config->get('u2f.register.postSuccessRedirectRoute')) {
70 70
 
@@ -88,14 +88,14 @@  discard block
 block discarded – undo
88 88
     public function authData()
89 89
     {
90 90
 
91
-        if($this->u2f->check()) {
91
+        if ($this->u2f->check()) {
92 92
             return $this->redirectAfterSuccessAuth();
93 93
         }
94 94
 
95 95
         $req = $this->u2f->getAuthenticateData(Auth::user());
96 96
         Event::fire('u2f.authentication.data', [ 'user' => Auth::user() ]);
97 97
 
98
-        session(['u2f.authenticationData' => $req]);
98
+        session([ 'u2f.authenticationData' => $req ]);
99 99
 
100 100
         return view($this->config->get('u2f.authenticate.view'))
101 101
             ->with('authenticationData', $req);
Please login to merge, or discard this patch.
src/U2f.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
     public function __construct(Config $config, Session $session)
38 38
     {
39 39
         $scheme = Request::isSecure() ? "https://" : "http://";
40
-        $this->u2f = new \u2flib_server\U2F($scheme . Request::getHttpHost());
40
+        $this->u2f = new \u2flib_server\U2F($scheme.Request::getHttpHost());
41 41
         $this->config = $config;
42 42
         $this->session = $session;
43 43
     }
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
         $U2fKey->counter = $reg->counter;
115 115
         $U2fKey->save();
116 116
         
117
-        session([$this->config->get('u2f.sessionU2fName') => true]);
117
+        session([ $this->config->get('u2f.sessionU2fName') => true ]);
118 118
 
119 119
         return $U2fKey;
120 120
     }
Please login to merge, or discard this patch.