Changeset View
Changeset View
Standalone View
Standalone View
src/app/Providers/AuthServiceProvider.php
Show All 36 Lines | public function boot() | ||||
// Override the default route to avoid rate-limiting. | // Override the default route to avoid rate-limiting. | ||||
Route::post('/token', [ | Route::post('/token', [ | ||||
'uses' => 'AccessTokenController@issueToken', | 'uses' => 'AccessTokenController@issueToken', | ||||
'as' => 'passport.token', | 'as' => 'passport.token', | ||||
]); | ]); | ||||
} | } | ||||
); | ); | ||||
Passport::tokensCan([ | |||||
'api' => 'Access API', | |||||
'mfa' => 'Access MFA API', | |||||
machniak: API. | |||||
]); | |||||
Passport::tokensExpireIn(now()->addMinutes(\config('auth.token_expiry_minutes'))); | Passport::tokensExpireIn(now()->addMinutes(\config('auth.token_expiry_minutes'))); | ||||
Passport::refreshTokensExpireIn(now()->addMinutes(\config('auth.refresh_token_expiry_minutes'))); | Passport::refreshTokensExpireIn(now()->addMinutes(\config('auth.refresh_token_expiry_minutes'))); | ||||
Passport::personalAccessTokensExpireIn(now()->addMonths(6)); | Passport::personalAccessTokensExpireIn(now()->addMonths(6)); | ||||
Passport::useClientModel(\App\Auth\PassportClient::class); | |||||
Passport::tokenModel()::observe(\App\Observers\Passport\TokenObserver::class); | |||||
} | } | ||||
} | } |
API.