Skip to content

Commit e0b7599

Browse files
committed
Fixed issue with middleware blocking access to non-crm api
1 parent b2cdae9 commit e0b7599

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313
- Activity Feed / Timelines
1414
- CSV Import / Export
1515

16-
<!--- ## 1.0.0 - 2021-XX-XX
16+
<!--- ## 1.0.0 - 2022-XX-XX
1717
### Added
1818
### Changed
1919
### Fixed
2020
### Removed --->
2121

22+
## 0.10.1 - 2022-03-22
23+
### Fixed
24+
- Issue with middleware affecting access to non-crm API
25+
2226
## 0.10.0 - 2022-03-11
2327
### Added
2428
- Link to owner profile on contacts

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ https://laravel.com/docs/6.x/authentication
5252
#### Step 3. Require the current package using composer:
5353

5454
```bash
55-
composer require venturedrake/laravel-crm:^0.9
55+
composer require venturedrake/laravel-crm:^0.10
5656
```
5757

5858
#### Step 4. Publish the migrations, config & assets
@@ -145,7 +145,7 @@ Note if you modified the route_prefix setting from the default the above url wil
145145
#### Step 1. Run the following to the update migrations and publish assets:
146146

147147
```bash
148-
composer require venturedrake/laravel-crm::^0.9
148+
composer require venturedrake/laravel-crm::^0.10
149149
php artisan vendor:publish --provider="VentureDrake\LaravelCrm\LaravelCrmServiceProvider" --tag="migrations"
150150
php artisan vendor:publish --provider="VentureDrake\LaravelCrm\LaravelCrmServiceProvider" --tag="config"
151151
php artisan vendor:publish --provider="VentureDrake\LaravelCrm\LaravelCrmServiceProvider" --tag="assets" --force

config/package.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
|
1414
*/
1515

16-
'version' => '0.10.0',
16+
'version' => '0.10.1',
1717

1818
];

src/LaravelCrmServiceProvider.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,13 @@ class_alias('App\Models\Team', 'App\Team');
9999

100100
if (config('laravel-crm.teams')) {
101101
$router->pushMiddlewareToGroup('web', TeamsPermission::class);
102-
$router->pushMiddlewareToGroup('api', TeamsPermission::class);
102+
$router->pushMiddlewareToGroup('crm-api', TeamsPermission::class);
103103
}
104104

105105
$router->pushMiddlewareToGroup('crm', Settings::class);
106-
$router->pushMiddlewareToGroup('api', Settings::class);
106+
$router->pushMiddlewareToGroup('crm-api', Settings::class);
107107
$router->pushMiddlewareToGroup('crm', HasCrmAccess::class);
108-
$router->pushMiddlewareToGroup('api', HasCrmAccess::class);
108+
$router->pushMiddlewareToGroup('crm-api', HasCrmAccess::class);
109109
$router->pushMiddlewareToGroup('crm', LastOnlineAt::class);
110110
$router->pushMiddlewareToGroup('crm', SystemCheck::class);
111111

@@ -285,7 +285,7 @@ protected function routeConfiguration()
285285
{
286286
return [
287287
'prefix' => config('laravel-crm.route_prefix'),
288-
'middleware' => array_unique(array_merge(['web','crm'], config('laravel-crm.route_middleware') ?? [])),
288+
'middleware' => array_unique(array_merge(['web','crm','crm-api'], config('laravel-crm.route_middleware') ?? [])),
289289
];
290290
}
291291

0 commit comments

Comments
 (0)