Created
May 25, 2017 12:52
-
-
Save joselfonseca/f608720fb3deefee44600e9b1583c019 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Providers; | |
| use Carbon\Carbon; | |
| use Laravel\Passport\Passport; | |
| use Joselfonseca\LaravelApiTools\Auth\PassportAuthenticationProvider; | |
| use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; | |
| class AuthServiceProvider extends ServiceProvider | |
| { | |
| /** | |
| * The policy mappings for the application. | |
| * | |
| * @var array | |
| */ | |
| protected $policies = [ | |
| ]; | |
| /** | |
| * Register any authentication / authorization services. | |
| * | |
| * @return void | |
| */ | |
| public function boot() | |
| { | |
| $this->registerPolicies(); | |
| Passport::routes(); | |
| Passport::tokensExpireIn(Carbon::now()->addHours(10)); | |
| Passport::refreshTokensExpireIn(Carbon::now()->addDays(3)); | |
| app('Dingo\Api\Auth\Auth')->extend('passport', function ($app) { | |
| return app(PassportAuthenticationProvider::class); | |
| }); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment