Completed
Push — master ( a4a3a5...4bc804 )
by LAHAXE
01:45
created
config/u2f.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
-     * User: LAHAXE Arnaud
4
-     * Date: 18/05/2015
5
-     * Time: 17:49
6
-     * FileName : u2f.php
7
-     * Project : laravel-u2f
8
-     */
3
+ * User: LAHAXE Arnaud
4
+ * Date: 18/05/2015
5
+ * Time: 17:49
6
+ * FileName : u2f.php
7
+ * Project : laravel-u2f
8
+ */
9 9
 
10 10
 return [
11 11
     /*
Please login to merge, or discard this patch.
src/http/Controllers/U2fController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
         list($req, $sigs) = $this->u2f->getRegisterData(\Auth::user());
45 45
         \Event::fire('u2f.register.data', [ 'user' => \Auth::user() ]);
46 46
 
47
-        session(['u2f.registerData' => $req]);
47
+        session([ 'u2f.registerData' => $req ]);
48 48
 
49 49
         return view($this->config->get('u2f.register.view'))
50 50
             ->with('currentKeys', $sigs)
@@ -87,14 +87,14 @@  discard block
 block discarded – undo
87 87
     public function authData()
88 88
     {
89 89
 
90
-        if($this->u2f->check()) {
90
+        if ($this->u2f->check()) {
91 91
             return $this->redirectAfterSuccessAuth();
92 92
         }
93 93
 
94 94
         $req = $this->u2f->getAuthenticateData(\Auth::user());
95 95
         \Event::fire('u2f.authentication.data', [ 'user' => \Auth::user() ]);
96 96
 
97
-        session(['u2f.authenticationData' => $req]);
97
+        session([ 'u2f.authenticationData' => $req ]);
98 98
 
99 99
         return view($this->config->get('u2f.authenticate.view'))
100 100
             ->with('authenticationData', $req);
Please login to merge, or discard this patch.
src/http/Middleware/U2f.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -43,14 +43,14 @@
 block discarded – undo
43 43
      */
44 44
     public function handle($request, Closure $next)
45 45
     {
46
-        if(!$this->config->get('u2f.enable')) {
46
+        if (!$this->config->get('u2f.enable')) {
47 47
             return $next($request);
48 48
         }
49 49
 
50 50
         if (!$this->u2f->check()) {
51
-            if(!\Auth::guest()){
52
-                if(
53
-                    U2fKey::where('user_id', '=', \Auth::user()->id)->count()  === 0
51
+            if (!\Auth::guest()) {
52
+                if (
53
+                    U2fKey::where('user_id', '=', \Auth::user()->id)->count() === 0
54 54
                     && $this->config->get('u2f.byPassUserWithoutKey')
55 55
                 ) {
56 56
                     return $next($request);
Please login to merge, or discard this patch.
src/U2fServiceProvider.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -31,23 +31,23 @@
 block discarded – undo
31 31
             $router->get('register', [
32 32
                 'uses' => 'U2fController@registerData',
33 33
                 'as' => 'u2f.register.data',
34
-               'middleware' => 'auth'
34
+                'middleware' => 'auth'
35 35
             ]);
36 36
             $router->post('register', [
37 37
                 'uses' => 'U2fController@register',
38 38
                 'as' => 'u2f.register',
39
-               'middleware' => 'auth'
39
+                'middleware' => 'auth'
40 40
             ]);
41 41
 
42 42
             $router->get('auth', [
43 43
                 'uses' => 'U2fController@authData',
44 44
                 'as' => 'u2f.auth.data',
45
-               'middleware' => 'auth'
45
+                'middleware' => 'auth'
46 46
             ]);
47 47
             $router->post('auth', [
48 48
                 'uses' => 'U2fController@auth',
49 49
                 'as' => 'u2f.auth',
50
-               'middleware' => 'auth'
50
+                'middleware' => 'auth'
51 51
             ]);
52 52
         });
53 53
 
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -53,17 +53,17 @@
 block discarded – undo
53 53
 
54 54
 
55 55
         $this->publishes([
56
-            __DIR__ . '/../database/migrations/' => base_path('/database/migrations')
56
+            __DIR__.'/../database/migrations/' => base_path('/database/migrations')
57 57
         ], 'migrations');
58 58
 
59
-        $this->publishes([ (__DIR__ . '/../config/u2f.php') => config_path('u2f.php') ], 'config');
59
+        $this->publishes([ (__DIR__.'/../config/u2f.php') => config_path('u2f.php') ], 'config');
60 60
 
61 61
         $this->publishes([
62
-            __DIR__. '/../resources/js' => public_path('vendor/u2f'),
62
+            __DIR__.'/../resources/js' => public_path('vendor/u2f'),
63 63
         ], 'public');
64 64
 
65
-        $this->loadViewsFrom(__DIR__ . '/../views/', 'u2f');
66
-        $this->loadTranslationsFrom(__DIR__ . '/../resources/lang', 'u2f');
65
+        $this->loadViewsFrom(__DIR__.'/../views/', 'u2f');
66
+        $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'u2f');
67 67
 
68 68
     }
69 69
 
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
     }
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
         $U2fKey->counter = $reg->counter;
116 116
         $U2fKey->save();
117 117
         
118
-        session([$this->config->get('u2f.sessionU2fName') => true]);
118
+        session([ $this->config->get('u2f.sessionU2fName') => true ]);
119 119
 
120 120
         return $U2fKey;
121 121
     }
Please login to merge, or discard this patch.