Skip to content

Commit 963075a

Browse files
committed
update
1 parent c539c40 commit 963075a

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/AuthorizationServerFactory.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,38 +39,36 @@ public function __invoke()
3939
$scope = implode(' ', array_keys($scope));
4040
$server->setDefaultScope($scope);
4141

42-
$tokenExpiresIn = new DateInterval($this->config->get('oauth.expire_in.token'));
43-
4442
$server->enableGrantType(
4543
new \League\OAuth2\Server\Grant\ClientCredentialsGrant(),
46-
$tokenExpiresIn
44+
new DateInterval($this->config->get('oauth.expire_in.personal_token'))
4745
);
4846

4947
$server->enableGrantType(
5048
$this->makeAuthCodeGrant(),
51-
$tokenExpiresIn
49+
new DateInterval($this->config->get('oauth.expire_in.personal_token'))
5250
);
5351

5452
$server->enableGrantType(
5553
$this->makeRefreshTokenGrant(),
56-
$tokenExpiresIn
54+
new DateInterval($this->config->get('oauth.expire_in.refresh_token'))
5755
);
5856

5957
$server->enableGrantType(
6058
$this->makePasswordGrant(),
61-
$tokenExpiresIn
59+
new DateInterval($this->config->get('oauth.expire_in.token'))
6260
);
6361

6462
if($this->config->get('oauth.use_otp_grant', false)) {
6563
$server->enableGrantType(
6664
$this->makeOtpGrant(),
67-
$tokenExpiresIn
65+
new DateInterval($this->config->get('oauth.expire_in.token'))
6866
);
6967
}
7068

7169
$server->enableGrantType(
7270
$this->makeUserGrant(),
73-
$tokenExpiresIn
71+
new DateInterval($this->config->get('oauth.expire_in.token'))
7472
);
7573

7674
return $server;

0 commit comments

Comments
 (0)