Skip to content

Commit

Permalink
♻ Code improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
JVillator0 committed Jul 19, 2021
1 parent e53b4ce commit e6adc98
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
];
```
Expand Down
2 changes: 2 additions & 0 deletions src/config/oauth-client.php → config/oauth-client.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
| $this->http->post(config('oauth-client.services.service1') . '/blog')
|
*/

'external_services' => [
// "example" => "https://myservice.com/api"
],

];
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;

class EnsureJwtIsValidMiddleware
class EnsureJwtIsValid
{
/**
* Handle an incoming request.
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/OAuthServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand Down

0 comments on commit e6adc98

Please sign in to comment.