Skip to content

Commit 72d0675

Browse files
authored
Merge pull request #73 from RonasIT/38_fix_adding_middleware_for_telescope_authorization
fix: adding middleware for telescope authorization
2 parents ce68189 + 5f1b9a9 commit 72d0675

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/Commands/InitCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,14 +252,14 @@ public function handle(): void
252252

253253
$this->setupComposerHooks();
254254

255-
$this->changeMiddlewareForTelescopeAuthorization();
256-
257255
$this->setAutoDocContactEmail($this->codeOwnerEmail);
258256

259257
foreach ($this->shellCommands as $shellCommand) {
260258
shell_exec("{$shellCommand} --ansi");
261259
}
262260

261+
$this->changeMiddlewareForTelescopeAuthorization();
262+
263263
$this->publishWebLogin();
264264

265265
if ($this->shouldUninstallPackage) {

tests/InitCommandTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ public function testRunWithoutAdminAndReadmeCreationConvertAppNameToPascalCaseTe
1414
'\Winter\LaravelConfigWriter',
1515
$this->changeEnvFileCall('.env.example', 'env.example.yml', 'env.example_app_name_pascal_case.yml'),
1616
$this->changeEnvFileCall('.env.development', 'env.development.yml', 'env.development_app_name_pascal_case.yml'),
17-
$this->changeConfigFileCall('config/telescope.php', 'telescope_config.php', 'telescope_config_after_initialization.php'),
1817
$this->changeConfigFileCall('config/auto-doc.php', 'auto_doc.php', 'auto_doc_after_changes.php'),
18+
$this->changeConfigFileCall('config/telescope.php', 'telescope_config.php', 'telescope_config_after_initialization.php'),
1919
);
2020

2121
$this->mockNativeFunction(
@@ -68,8 +68,8 @@ public function testRunWithoutAdminAndReadmeCreation()
6868
'\Winter\LaravelConfigWriter',
6969
$this->changeEnvFileCall('.env', 'env.example.yml', 'env.example_app_name_pascal_case.yml'),
7070
$this->changeEnvFileCall('.env.development', 'env.development.yml', 'env.development_app_name_pascal_case.yml'),
71-
$this->changeConfigFileCall('config/telescope.php', 'telescope_config.php', 'telescope_config_after_initialization.php'),
7271
$this->changeConfigFileCall('config/auto-doc.php', 'auto_doc.php', 'auto_doc_after_changes.php'),
72+
$this->changeConfigFileCall('config/telescope.php', 'telescope_config.php', 'telescope_config_after_initialization.php'),
7373
);
7474

7575
$this->mockNativeFunction(
@@ -121,8 +121,8 @@ public function testRunWithAdminAndWithoutReadmeCreation()
121121
'\Winter\LaravelConfigWriter',
122122
$this->changeEnvFileCall('.env.example', 'env.example.yml', 'env.example_app_name_not_pascal_case.yml'),
123123
$this->changeEnvFileCall('.env.development', 'env.development.yml', 'env.development_app_name_not_pascal_case.yml'),
124-
$this->changeConfigFileCall('config/telescope.php', 'telescope_config.php', 'telescope_config_after_initialization.php'),
125124
$this->changeConfigFileCall('config/auto-doc.php', 'auto_doc.php', 'auto_doc_after_changes.php'),
125+
$this->changeConfigFileCall('config/telescope.php', 'telescope_config.php', 'telescope_config_after_initialization.php'),
126126
);
127127

128128
$this->mockNativeFunction(
@@ -180,8 +180,8 @@ public function testRunWithAdminAndDefaultReadmeCreation()
180180
$this->changeEnvFileCall('.env.development', 'env.development.yml', 'env.development_app_name_not_pascal_case.yml'),
181181
$this->changeEnvFileCall('.env.development', 'env.development_app_name_not_pascal_case.yml', 'env.development_clerk_credentials_added.yml'),
182182
$this->changeEnvFileCall('.env.example', 'env.example_app_name_not_pascal_case.yml', 'env.example_clerk_credentials_added.yml'),
183-
$this->changeConfigFileCall('config/telescope.php', 'telescope_config.php', 'telescope_config_after_initialization.php'),
184183
$this->changeConfigFileCall('config/auto-doc.php', 'auto_doc.php', 'auto_doc_after_changes.php'),
184+
$this->changeConfigFileCall('config/telescope.php', 'telescope_config.php', 'telescope_config_after_initialization.php'),
185185
);
186186

187187
$this->mockNativeFunction(
@@ -313,8 +313,8 @@ public function testRunWithAdminAndPartialReadmeCreation()
313313
'\Winter\LaravelConfigWriter',
314314
$this->changeEnvFileCall('.env.example', 'env.example.yml', 'env.example_app_name_not_pascal_case.yml'),
315315
$this->changeEnvFileCall('.env.development', 'env.development.yml', 'env.development_app_name_not_pascal_case.yml'),
316-
$this->changeConfigFileCall('config/telescope.php', 'telescope_config.php', 'telescope_config_after_initialization.php'),
317316
$this->changeConfigFileCall('config/auto-doc.php', 'auto_doc.php', 'auto_doc_after_changes.php'),
317+
$this->changeConfigFileCall('config/telescope.php', 'telescope_config.php', 'telescope_config_after_initialization.php'),
318318
);
319319

320320
$this->mockNativeFunction(
@@ -420,8 +420,8 @@ public function testRunWithAdminAndFullReadmeCreationAndRemovingInitializatorIns
420420
'\Winter\LaravelConfigWriter',
421421
$this->changeEnvFileCall('.env.example', 'env.example.yml', 'env.example_app_name_not_pascal_case.yml'),
422422
$this->changeEnvFileCall('.env.development', 'env.development.yml', 'env.development_app_name_not_pascal_case.yml'),
423-
$this->changeConfigFileCall('config/telescope.php', 'telescope_config.php', 'telescope_config_after_initialization.php'),
424423
$this->changeConfigFileCall('config/auto-doc.php', 'auto_doc.php', 'auto_doc_after_changes.php'),
424+
$this->changeConfigFileCall('config/telescope.php', 'telescope_config.php', 'telescope_config_after_initialization.php'),
425425
);
426426

427427
$this->mockNativeFunction(
@@ -545,8 +545,8 @@ public function testRunWithoutAdminAndUsingTelescope()
545545
'\Winter\LaravelConfigWriter',
546546
$this->changeEnvFileCall('.env.example', 'env.example.yml', 'env.example_app_name_not_pascal_case.yml'),
547547
$this->changeEnvFileCall('.env.development', 'env.development.yml', 'env.development_app_name_not_pascal_case.yml'),
548-
$this->changeConfigFileCall('config/telescope.php', 'telescope_config.php', 'telescope_config_after_initialization.php'),
549548
$this->changeConfigFileCall('config/auto-doc.php', 'auto_doc.php', 'auto_doc_after_changes.php'),
549+
$this->changeConfigFileCall('config/telescope.php', 'telescope_config.php', 'telescope_config_after_initialization.php'),
550550
);
551551

552552
$this->mockNativeFunction(
@@ -664,8 +664,8 @@ public function testRunWithClerkMobileAppWithPintInstalled(): void
664664
$this->changeEnvFileCall('.env.development', 'env.development.yml', 'env.development_app_name_not_pascal_case.yml'),
665665
$this->changeEnvFileCall('.env.development', 'env.development_app_name_not_pascal_case.yml', 'env.development_clerk_credentials_added_mobile_app.yml'),
666666
$this->changeEnvFileCall('.env.example', 'env.example_app_name_not_pascal_case.yml', 'env.example_clerk_credentials_added_mobile_app.yml'),
667-
$this->changeConfigFileCall('config/telescope.php', 'telescope_config.php', 'telescope_config_after_initialization.php'),
668667
$this->changeConfigFileCall('config/auto-doc.php', 'auto_doc.php', 'auto_doc_after_changes.php'),
668+
$this->changeConfigFileCall('config/telescope.php', 'telescope_config.php', 'telescope_config_after_initialization.php'),
669669
);
670670

671671
$this->mockNativeFunction(
@@ -795,8 +795,8 @@ public function testRunWithClerkAdditionalAdminsWithoutDefaultAdmin(): void
795795
$this->changeEnvFileCall('.env.development', 'env.development.yml', 'env.development_app_name_not_pascal_case.yml'),
796796
$this->changeEnvFileCall('.env.development', 'env.development_app_name_not_pascal_case.yml', 'env.development_clerk_credentials_added.yml'),
797797
$this->changeEnvFileCall('.env.example', 'env.example.yml', 'env.example_clerk_credentials_added.yml'),
798-
$this->changeConfigFileCall('config/telescope.php', 'telescope_config.php', 'telescope_config_after_initialization.php'),
799798
$this->changeConfigFileCall('config/auto-doc.php', 'auto_doc.php', 'auto_doc_after_changes.php'),
799+
$this->changeConfigFileCall('config/telescope.php', 'telescope_config.php', 'telescope_config_after_initialization.php'),
800800
);
801801

802802
$this->mockNativeFunction(

0 commit comments

Comments
 (0)