Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117756048
AuthServiceProvider.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
AuthServiceProvider.php
View Options
<?php
namespace
App\Providers
;
use
Illuminate\Support\Facades\Auth
;
use
Illuminate\Support\Facades\Route
;
use
Illuminate\Foundation\Support\Providers\AuthServiceProvider
as
ServiceProvider
;
use
Laravel\Passport\Passport
;
class
AuthServiceProvider
extends
ServiceProvider
{
/**
* The policy mappings for the application.
*
* @var array<class-string, class-string>
*/
protected
$policies
=
[
// 'App\Model' => 'App\Policies\ModelPolicy',
];
/**
* Register any authentication / authorization services.
*
* @return void
*/
public
function
boot
()
{
$this
->
registerPolicies
();
// Hashes all secrets and thus makes them non-recoverable
/* Passport::hashClientSecrets(); */
// Only enable routes for access tokens
Passport
::
routes
(
function
(
$router
)
{
$router
->
forAccessTokens
();
// Override the default route to avoid rate-limiting.
Route
::
post
(
'/token'
,
[
'uses'
=>
'AccessTokenController@issueToken'
,
'as'
=>
'passport.token'
,
]);
}
);
Passport
::
tokensExpireIn
(
now
()->
addMinutes
(
\config
(
'auth.token_expiry_minutes'
)));
Passport
::
refreshTokensExpireIn
(
now
()->
addMinutes
(
\config
(
'auth.refresh_token_expiry_minutes'
)));
Passport
::
personalAccessTokensExpireIn
(
now
()->
addMonths
(
6
));
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Apr 4, 8:27 AM (2 w, 3 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
fd/3d/8421730f1f30b4a7203bd7cdd737
Default Alt Text
AuthServiceProvider.php (1 KB)
Attached To
Mode
rK kolab
Attached
Detach File
Event Timeline