@@ -47,8 +47,9 @@ |
||
47 | 47 | */ |
48 | 48 | private function isActivated($user): bool |
49 | 49 | { |
50 | - if ( ! $user instanceof CanBeActivated) |
|
51 | - return false; |
|
50 | + if ( ! $user instanceof CanBeActivated) { |
|
51 | + return false; |
|
52 | + } |
|
52 | 53 | |
53 | 54 | return $user->isActive(); |
54 | 55 | } |
@@ -36,8 +36,9 @@ |
||
36 | 36 | |
37 | 37 | abort_if(is_null($metric), Response::HTTP_NOT_FOUND, __('Metric not found')); |
38 | 38 | |
39 | - if ($metric->authorizedToSee($request)) |
|
40 | - return response()->json($metric->resolve($request)->toArray()); |
|
39 | + if ($metric->authorizedToSee($request)) { |
|
40 | + return response()->json($metric->resolve($request)->toArray()); |
|
41 | + } |
|
41 | 42 | |
42 | 43 | return response()->json([ |
43 | 44 | 'message' => 'Access Not Allowed', |
@@ -60,7 +60,7 @@ |
||
60 | 60 | { |
61 | 61 | $view->with( |
62 | 62 | 'foundationNotifications', |
63 | - $this->notifier->notifications()->transform(function (array $notification) { |
|
63 | + $this->notifier->notifications()->transform(function(array $notification) { |
|
64 | 64 | return static::prepareNotification($notification); |
65 | 65 | }) |
66 | 66 | ); |
@@ -33,17 +33,17 @@ |
||
33 | 33 | public function map(): void |
34 | 34 | { |
35 | 35 | $this->prefix('password/confirm') |
36 | - ->name('password.confirm.') |
|
37 | - ->middleware(['arcanesoft']) |
|
38 | - ->group(function () { |
|
39 | - // admin::auth.password.confirm.create |
|
40 | - $this->get('/', [ConfirmPasswordController::class, 'create']) |
|
41 | - ->name('create'); |
|
42 | - |
|
43 | - // admin::auth.password.confirm.store |
|
44 | - $this->post('/', [ConfirmPasswordController::class, 'store']) |
|
45 | - ->name('store'); |
|
46 | - }); |
|
36 | + ->name('password.confirm.') |
|
37 | + ->middleware(['arcanesoft']) |
|
38 | + ->group(function () { |
|
39 | + // admin::auth.password.confirm.create |
|
40 | + $this->get('/', [ConfirmPasswordController::class, 'create']) |
|
41 | + ->name('create'); |
|
42 | + |
|
43 | + // admin::auth.password.confirm.store |
|
44 | + $this->post('/', [ConfirmPasswordController::class, 'store']) |
|
45 | + ->name('store'); |
|
46 | + }); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | } |
@@ -35,7 +35,7 @@ |
||
35 | 35 | $this->prefix('password/confirm') |
36 | 36 | ->name('password.confirm.') |
37 | 37 | ->middleware(['arcanesoft']) |
38 | - ->group(function () { |
|
38 | + ->group(function() { |
|
39 | 39 | // admin::auth.password.confirm.create |
40 | 40 | $this->get('/', [ConfirmPasswordController::class, 'create']) |
41 | 41 | ->name('create'); |
@@ -35,24 +35,24 @@ |
||
35 | 35 | public function map(): void |
36 | 36 | { |
37 | 37 | $this->prefix('password') |
38 | - ->name('password.') |
|
39 | - ->middleware(['guest']) |
|
40 | - ->group(function () { |
|
41 | - // admin::auth.password.request |
|
42 | - $this->get('forgotten', [PasswordResetLinkController::class, 'create']) |
|
43 | - ->name('request'); |
|
44 | - |
|
45 | - // admin::auth.password.email |
|
46 | - $this->post('forgotten', [PasswordResetLinkController::class, 'store']) |
|
47 | - ->name('email'); |
|
48 | - |
|
49 | - // admin::auth.password.reset |
|
50 | - $this->get('reset/{token}', [ResetPasswordController::class, 'edit']) |
|
51 | - ->name('reset'); |
|
52 | - |
|
53 | - // admin::auth.password.update |
|
54 | - $this->post('reset', [ResetPasswordController::class, 'update']) |
|
55 | - ->name('update'); |
|
56 | - }); |
|
38 | + ->name('password.') |
|
39 | + ->middleware(['guest']) |
|
40 | + ->group(function () { |
|
41 | + // admin::auth.password.request |
|
42 | + $this->get('forgotten', [PasswordResetLinkController::class, 'create']) |
|
43 | + ->name('request'); |
|
44 | + |
|
45 | + // admin::auth.password.email |
|
46 | + $this->post('forgotten', [PasswordResetLinkController::class, 'store']) |
|
47 | + ->name('email'); |
|
48 | + |
|
49 | + // admin::auth.password.reset |
|
50 | + $this->get('reset/{token}', [ResetPasswordController::class, 'edit']) |
|
51 | + ->name('reset'); |
|
52 | + |
|
53 | + // admin::auth.password.update |
|
54 | + $this->post('reset', [ResetPasswordController::class, 'update']) |
|
55 | + ->name('update'); |
|
56 | + }); |
|
57 | 57 | } |
58 | 58 | } |
@@ -37,7 +37,7 @@ |
||
37 | 37 | $this->prefix('password') |
38 | 38 | ->name('password.') |
39 | 39 | ->middleware(['guest']) |
40 | - ->group(function () { |
|
40 | + ->group(function() { |
|
41 | 41 | // admin::auth.password.request |
42 | 42 | $this->get('forgotten', [PasswordResetLinkController::class, 'create']) |
43 | 43 | ->name('request'); |
@@ -53,12 +53,12 @@ discard block |
||
53 | 53 | $this->prefix('login')->name('login.')->middleware(['guest'])->group(function () { |
54 | 54 | // admin::auth.login.create |
55 | 55 | $this->get('/', [LoginController::class, 'create']) |
56 | - ->name('create'); |
|
56 | + ->name('create'); |
|
57 | 57 | |
58 | 58 | // admin::auth.login.store |
59 | 59 | $this->post('/', [LoginController::class, 'store']) |
60 | - ->middleware([LoginRateLimiter::middleware()]) |
|
61 | - ->name('store'); |
|
60 | + ->middleware([LoginRateLimiter::middleware()]) |
|
61 | + ->name('store'); |
|
62 | 62 | }); |
63 | 63 | } |
64 | 64 | |
@@ -88,6 +88,6 @@ discard block |
||
88 | 88 | { |
89 | 89 | // admin::auth.logout |
90 | 90 | $this->delete('logout', [LoginController::class, 'destroy']) |
91 | - ->name('logout'); |
|
91 | + ->name('logout'); |
|
92 | 92 | } |
93 | 93 | } |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | */ |
51 | 51 | protected function mapLoginRoutes(): void |
52 | 52 | { |
53 | - $this->prefix('login')->name('login.')->middleware(['guest'])->group(function () { |
|
53 | + $this->prefix('login')->name('login.')->middleware(['guest'])->group(function() { |
|
54 | 54 | // admin::auth.login.create |
55 | 55 | $this->get('/', [LoginController::class, 'create']) |
56 | 56 | ->name('create'); |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | if ( ! Auth::isTwoFactorEnabled()) |
71 | 71 | return; |
72 | 72 | |
73 | - $this->prefix('two-factor-challenge')->name('two-factor.')->group(function () { |
|
73 | + $this->prefix('two-factor-challenge')->name('two-factor.')->group(function() { |
|
74 | 74 | // admin::auth.login.two-factor.create |
75 | 75 | $this->get('/', [TwoFactorLoginController::class, 'create']) |
76 | 76 | ->name('create'); |
@@ -67,8 +67,9 @@ |
||
67 | 67 | */ |
68 | 68 | private function mapTwoFactorRoutes(): void |
69 | 69 | { |
70 | - if ( ! Auth::isTwoFactorEnabled()) |
|
71 | - return; |
|
70 | + if ( ! Auth::isTwoFactorEnabled()) { |
|
71 | + return; |
|
72 | + } |
|
72 | 73 | |
73 | 74 | $this->prefix('two-factor-challenge')->name('two-factor.')->group(function () { |
74 | 75 | // admin::auth.login.two-factor.create |
@@ -23,8 +23,8 @@ |
||
23 | 23 | */ |
24 | 24 | public function map(): void |
25 | 25 | { |
26 | - $this->adminGroup(function () { |
|
27 | - $this->prefix('auth')->name('auth.')->group(function () { |
|
26 | + $this->adminGroup(function() { |
|
27 | + $this->prefix('auth')->name('auth.')->group(function() { |
|
28 | 28 | static::mapRouteClasses([ |
29 | 29 | ConfirmPasswordRoutes::class, |
30 | 30 | LoginRoutes::class, |
@@ -115,8 +115,9 @@ |
||
115 | 115 | */ |
116 | 116 | public static function middleware(): ?string |
117 | 117 | { |
118 | - if ( ! static::isEnabled()) |
|
119 | - return null; |
|
118 | + if ( ! static::isEnabled()) { |
|
119 | + return null; |
|
120 | + } |
|
120 | 121 | |
121 | 122 | return 'throttle:'.Auth::config('limiters.login.throttle'); |
122 | 123 | } |
@@ -55,8 +55,9 @@ |
||
55 | 55 | */ |
56 | 56 | protected function shouldConfirmPassword(Request $request): bool |
57 | 57 | { |
58 | - if ( ! $this->hasPassword($request)) |
|
59 | - return false; |
|
58 | + if ( ! $this->hasPassword($request)) { |
|
59 | + return false; |
|
60 | + } |
|
60 | 61 | |
61 | 62 | $confirmedAt = time() - $request->session()->get('auth.password_confirmed_at', 0); |
62 | 63 |