Skip to content

Commit e6adc98

Browse files
committed
♻ Code improvements
1 parent e53b4ce commit e6adc98

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ A package that allows secure communication between two or more projects, focused
3333
```php
3434
protected $routeMiddleware = [
3535
// Other middleware...
36-
'jwt' => \Diimolabs\Oauth2Client\Middleware\EnsureJwtIsValidMiddleware::class
36+
'jwt' => \Diimolabs\Oauth2Client\Middleware\EnsureJwtIsValid::class
3737
];
3838
```
3939

src/config/oauth-client.php renamed to config/oauth-client.php

+2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@
3030
| $this->http->post(config('oauth-client.services.service1') . '/blog')
3131
|
3232
*/
33+
3334
'external_services' => [
3435
// "example" => "https://myservice.com/api"
3536
],
37+
3638
];

src/Middleware/EnsureJwtIsValidMiddleware.php renamed to src/Middleware/EnsureJwtIsValid.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use Illuminate\Http\Request;
88
use Illuminate\Support\Facades\Log;
99

10-
class EnsureJwtIsValidMiddleware
10+
class EnsureJwtIsValid
1111
{
1212
/**
1313
* Handle an incoming request.
@@ -17,10 +17,10 @@ class EnsureJwtIsValidMiddleware
1717
* @param string $scopes
1818
* @return mixed
1919
*/
20-
public function handle(Request $request, Closure $next, $scopes = "")
20+
public function handle(Request $request, Closure $next, $scopes = '')
2121
{
2222
try {
23-
if (! $request->bearerToken()){
23+
if (! $request->bearerToken()) {
2424
return response()->json([
2525
'message' => 'You are not authorized'
2626
], 401);

src/OAuthServiceProvider.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class OAuthServiceProvider extends ServiceProvider
1010
public function boot()
1111
{
1212
$this->publishes([
13-
__DIR__ . '/config/oauth-client.php' => config_path('oauth-client.php')
13+
__DIR__ . '/../config/oauth-client.php' => config_path('oauth-client.php')
1414
], 'oauth-client');
1515
}
1616

0 commit comments

Comments
 (0)