@@ -53,17 +53,17 @@ |
||
| 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 | |
@@ -44,14 +44,14 @@ |
||
| 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); |
@@ -37,7 +37,7 @@ discard block |
||
| 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 |
||
| 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 | } |
@@ -87,7 +87,7 @@ |
||
| 87 | 87 | */ |
| 88 | 88 | public function authData() |
| 89 | 89 | { |
| 90 | - if($this->u2f->check()) { |
|
| 90 | + if ($this->u2f->check()) { |
|
| 91 | 91 | |
| 92 | 92 | return $this->redirectAfterSuccessAuth(); |
| 93 | 93 | } |