mirror of
https://github.com/koel/koel
synced 2024-11-10 14:44:13 +00:00
Merge pull request #175 from phanan/analysis-8K1oRq
Applied fixes from StyleCI
This commit is contained in:
commit
4a4c253261
6 changed files with 11 additions and 11 deletions
|
@ -3,9 +3,9 @@
|
|||
namespace App\Http;
|
||||
|
||||
use App\Http\Middleware\Authenticate;
|
||||
use App\Http\Middleware\GetUserFromToken;
|
||||
use Illuminate\Foundation\Http\Kernel as HttpKernel;
|
||||
use Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode;
|
||||
use App\Http\Middleware\GetUserFromToken;
|
||||
|
||||
class Kernel extends HttpKernel
|
||||
{
|
||||
|
|
|
@ -10,13 +10,14 @@ class GetUserFromToken extends BaseMiddleware
|
|||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, \Closure $next)
|
||||
{
|
||||
if (! $token = $this->auth->setRequest($request)->getToken()) {
|
||||
if (!$token = $this->auth->setRequest($request)->getToken()) {
|
||||
return $this->respond('tymon.jwt.absent', 'token_not_provided', 400);
|
||||
}
|
||||
|
||||
|
@ -28,7 +29,7 @@ class GetUserFromToken extends BaseMiddleware
|
|||
return $this->respond('tymon.jwt.invalid', 'token_invalid', $e->getStatusCode(), [$e]);
|
||||
}
|
||||
|
||||
if (! $user) {
|
||||
if (!$user) {
|
||||
return $this->respond('tymon.jwt.user_not_found', 'user_not_found', 404);
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ Route::group(['prefix' => 'api', 'namespace' => 'API'], function () {
|
|||
|
||||
Route::post('settings', 'SettingController@save');
|
||||
|
||||
Route::get('{song}/play', 'SongController@play');
|
||||
Route::get('{song}/play', 'SongController@play');
|
||||
Route::post('{song}/scrobble/{timestamp}', 'SongController@scrobble')->where([
|
||||
'timestamp' => '\d+',
|
||||
]);
|
||||
|
|
|
@ -4,7 +4,6 @@ namespace App;
|
|||
|
||||
use Illuminate\Http\Request;
|
||||
use Tymon\JWTAuth\JWTAuth as BaseJWTAuth;
|
||||
use Tymon\JWTAuth\Exceptions\JWTException;
|
||||
use Tymon\JWTAuth\JWTManager;
|
||||
use Tymon\JWTAuth\Providers\Auth\AuthInterface;
|
||||
use Tymon\JWTAuth\Providers\User\UserInterface;
|
||||
|
|
|
@ -7,7 +7,7 @@ class JWTEventListener
|
|||
/**
|
||||
* Handle user login events.
|
||||
*/
|
||||
public function onValidUser($event)
|
||||
public function onValidUser($event)
|
||||
{
|
||||
auth()->setUser($event->user);
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ class JWTEventListener
|
|||
/**
|
||||
* Register the listeners for the subscriber.
|
||||
*
|
||||
* @param Illuminate\Events\Dispatcher $events
|
||||
* @param Illuminate\Events\Dispatcher $events
|
||||
*/
|
||||
public function subscribe($events)
|
||||
{
|
||||
|
|
|
@ -161,8 +161,8 @@ return [
|
|||
|
||||
'storage' => function ($app) {
|
||||
return new Tymon\JWTAuth\Providers\Storage\IlluminateCacheAdapter($app['cache']);
|
||||
}
|
||||
},
|
||||
|
||||
]
|
||||
],
|
||||
|
||||
];
|
||||
|
|
Loading…
Reference in a new issue