Skip to content

Instantly share code, notes, and snippets.

@ActuallyACat
Last active September 10, 2015 23:31
Show Gist options
  • Select an option

  • Save ActuallyACat/a77143107e824bc786f2 to your computer and use it in GitHub Desktop.

Select an option

Save ActuallyACat/a77143107e824bc786f2 to your computer and use it in GitHub Desktop.
Temporary fix for tymon/jwt-auth ~0.6 to work in Lumen
<?php
namespace App\Providers;
use Illuminate\Auth\AuthManager;
use Illuminate\Cache\CacheManager;
use Tymon\JWTAuth\Providers\LumenServiceProvider;
class JWTAuthServiceProvider extends LumenServiceProvider
{
/**
* Register the bindings for the Auth provider
*/
protected function registerAuthProvider()
{
$this->app->singleton(
'tymon.jwt.provider.auth',
function ($app) {
$provider = $this->config('providers.auth');
return $app->make($provider, [new AuthManager($app)]);
}
);
}
/**
* Register the bindings for the Storage provider
*/
protected function registerStorageProvider()
{
$this->app->singleton(
'tymon.jwt.provider.storage',
function ($app) {
$provider = $this->config('providers.storage');
return $app->make($provider, [new CacheManager($app)]);
}
);
}
}
@jayhealey
Copy link

Great fix! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment