@@ -40,7 +40,7 @@ |
||
40 | 40 | if (!Schema::hasTable('2fa_tokens')) { |
41 | 41 | Schema::create( |
42 | 42 | '2fa_tokens', |
43 | - static function (Blueprint $table) { |
|
43 | + static function(Blueprint $table) { |
|
44 | 44 | $table->increments('id'); |
45 | 45 | $table->integer('user_id', false, true); |
46 | 46 | $table->datetime('expires_at'); |
@@ -298,7 +298,7 @@ |
||
298 | 298 | $token = null; |
299 | 299 | $unique = false; |
300 | 300 | $user = $this->getUser(); |
301 | - $expire = time() + (int)$this->config('cookie_lifetime'); |
|
301 | + $expire = time() + (int) $this->config('cookie_lifetime'); |
|
302 | 302 | while ($loops < 10 && false === $unique) { |
303 | 303 | $token = Str::random(64); |
304 | 304 | try { |
@@ -30,7 +30,7 @@ |
||
30 | 30 | |
31 | 31 | if (false === $cookieResult && true === $authResult) { |
32 | 32 | $cookieName = config('google2fa.cookie_name') ?? 'google2fa_token'; |
33 | - $lifetime = (int)(config('google2fa.cookie_lifetime') ?? 8035200); |
|
33 | + $lifetime = (int) (config('google2fa.cookie_lifetime') ?? 8035200); |
|
34 | 34 | $lifetime = $lifetime > 8035200 ? 8035200 : $lifetime; |
35 | 35 | $token = $authenticator->sessionGet(Constants::SESSION_TOKEN); |
36 | 36 | $response->withCookie(cookie()->make($cookieName, $token, $lifetime / 60)); |
@@ -145,9 +145,9 @@ |
||
145 | 145 | // check DB for token. |
146 | 146 | try { |
147 | 147 | $count = DB::table('2fa_tokens') |
148 | - ->where('token', $token) |
|
149 | - ->where('expires_at', '>', $time) |
|
150 | - ->where('user_id', $this->getUser()->id)->count(); |
|
148 | + ->where('token', $token) |
|
149 | + ->where('expires_at', '>', $time) |
|
150 | + ->where('user_id', $this->getUser()->id)->count(); |
|
151 | 151 | } catch (QueryException $e) { |
152 | 152 | $count = 0; |
153 | 153 | } |
@@ -24,13 +24,13 @@ |
||
24 | 24 | { |
25 | 25 | if (is_object($message)) { |
26 | 26 | try { |
27 | - $message = (string)$message; |
|
27 | + $message = (string) $message; |
|
28 | 28 | } catch (Exception $e) { |
29 | - $message = (string)$e->getMessage(); |
|
29 | + $message = (string) $e->getMessage(); |
|
30 | 30 | } |
31 | 31 | } |
32 | 32 | if (is_array($message)) { |
33 | - $message = (string)$message; |
|
33 | + $message = (string) $message; |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | return new MessageBag( |
@@ -31,8 +31,8 @@ |
||
31 | 31 | if (null !== $event->user) { |
32 | 32 | try { |
33 | 33 | DB::table('2fa_tokens') |
34 | - ->where('token', $token) |
|
35 | - ->where('user_id', $event->user->id)->delete(); |
|
34 | + ->where('token', $token) |
|
35 | + ->where('user_id', $event->user->id)->delete(); |
|
36 | 36 | } catch (QueryException $e) { |
37 | 37 | Log::error('Could not delete user token from database.'); |
38 | 38 | } |
@@ -28,7 +28,7 @@ |
||
28 | 28 | * If stored in a cookie, what's the lifetime of the cookie? |
29 | 29 | * Max value is 3 months (8035200 seconds). |
30 | 30 | */ |
31 | - 'cookie_lifetime' => (int)env('OTP_COOKIE_LIFETIME', 8035200), |
|
31 | + 'cookie_lifetime' => (int) env('OTP_COOKIE_LIFETIME', 8035200), |
|
32 | 32 | |
33 | 33 | 'guard' => '', |
34 | 34 |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | { |
20 | 20 | $this->publishes( |
21 | 21 | [ |
22 | - __DIR__ . '/config/config.php' => config_path('google2fa.php'), |
|
22 | + __DIR__.'/config/config.php' => config_path('google2fa.php'), |
|
23 | 23 | ] |
24 | 24 | ); |
25 | 25 | } |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | { |
45 | 45 | $this->app->register(EventServiceProvider::class); |
46 | 46 | $this->app->singleton( |
47 | - 'pragmarx.google2fa', static function ($app) { |
|
47 | + 'pragmarx.google2fa', static function($app) { |
|
48 | 48 | |
49 | 49 | return $app->make(Google2FA::class); |
50 | 50 | } |