diff --git a/README.md b/README.md index 0a39592..25c2db7 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ A package that allows secure communication between two or more projects, focused ```php protected $routeMiddleware = [ // Other middleware... - 'jwt' => \Diimolabs\Oauth2Client\Middleware\EnsureJwtIsValidMiddleware::class + 'jwt' => \Diimolabs\Oauth2Client\Middleware\EnsureJwtIsValid::class ]; ``` diff --git a/src/config/oauth-client.php b/config/oauth-client.php similarity index 99% rename from src/config/oauth-client.php rename to config/oauth-client.php index 3cac9d1..0e71da8 100644 --- a/src/config/oauth-client.php +++ b/config/oauth-client.php @@ -30,7 +30,9 @@ | $this->http->post(config('oauth-client.services.service1') . '/blog') | */ + 'external_services' => [ // "example" => "https://myservice.com/api" ], + ]; diff --git a/src/Middleware/EnsureJwtIsValidMiddleware.php b/src/Middleware/EnsureJwtIsValid.php similarity index 92% rename from src/Middleware/EnsureJwtIsValidMiddleware.php rename to src/Middleware/EnsureJwtIsValid.php index 764cb08..aadb5d6 100644 --- a/src/Middleware/EnsureJwtIsValidMiddleware.php +++ b/src/Middleware/EnsureJwtIsValid.php @@ -7,7 +7,7 @@ use Illuminate\Http\Request; use Illuminate\Support\Facades\Log; -class EnsureJwtIsValidMiddleware +class EnsureJwtIsValid { /** * Handle an incoming request. @@ -17,10 +17,10 @@ class EnsureJwtIsValidMiddleware * @param string $scopes * @return mixed */ - public function handle(Request $request, Closure $next, $scopes = "") + public function handle(Request $request, Closure $next, $scopes = '') { try { - if (! $request->bearerToken()){ + if (! $request->bearerToken()) { return response()->json([ 'message' => 'You are not authorized' ], 401); diff --git a/src/OAuthServiceProvider.php b/src/OAuthServiceProvider.php index 313b457..48fe801 100644 --- a/src/OAuthServiceProvider.php +++ b/src/OAuthServiceProvider.php @@ -10,7 +10,7 @@ class OAuthServiceProvider extends ServiceProvider public function boot() { $this->publishes([ - __DIR__ . '/config/oauth-client.php' => config_path('oauth-client.php') + __DIR__ . '/../config/oauth-client.php' => config_path('oauth-client.php') ], 'oauth-client'); }