mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-11-15 09:47:46 +05:30
Don't delete old sessions when issuing new access tokens using the Password or Client Credential grants. Fixes #32
This commit is contained in:
parent
d677b765b2
commit
76f2f6a5e1
@ -149,9 +149,6 @@ class ClientCredentials implements GrantTypeInterface {
|
|||||||
$accessTokenExpiresIn = ($this->accessTokenTTL !== null) ? $this->accessTokenTTL : $this->authServer->getAccessTokenTTL();
|
$accessTokenExpiresIn = ($this->accessTokenTTL !== null) ? $this->accessTokenTTL : $this->authServer->getAccessTokenTTL();
|
||||||
$accessTokenExpires = time() + $accessTokenExpiresIn;
|
$accessTokenExpires = time() + $accessTokenExpiresIn;
|
||||||
|
|
||||||
// Delete any existing sessions just to be sure
|
|
||||||
$this->authServer->getStorage('session')->deleteSession($authParams['client_id'], 'client', $authParams['client_id']);
|
|
||||||
|
|
||||||
// Create a new session
|
// Create a new session
|
||||||
$sessionId = $this->authServer->getStorage('session')->createSession($authParams['client_id'], 'client', $authParams['client_id']);
|
$sessionId = $this->authServer->getStorage('session')->createSession($authParams['client_id'], 'client', $authParams['client_id']);
|
||||||
|
|
||||||
|
@ -193,9 +193,6 @@ class Password implements GrantTypeInterface {
|
|||||||
$accessTokenExpiresIn = ($this->accessTokenTTL !== null) ? $this->accessTokenTTL : $this->authServer->getAccessTokenTTL();
|
$accessTokenExpiresIn = ($this->accessTokenTTL !== null) ? $this->accessTokenTTL : $this->authServer->getAccessTokenTTL();
|
||||||
$accessTokenExpires = time() + $accessTokenExpiresIn;
|
$accessTokenExpires = time() + $accessTokenExpiresIn;
|
||||||
|
|
||||||
// Delete any existing sessions just to be sure
|
|
||||||
$this->authServer->getStorage('session')->deleteSession($authParams['client_id'], 'user', $userId);
|
|
||||||
|
|
||||||
// Create a new session
|
// Create a new session
|
||||||
$sessionId = $this->authServer->getStorage('session')->createSession($authParams['client_id'], 'user', $userId);
|
$sessionId = $this->authServer->getStorage('session')->createSession($authParams['client_id'], 'user', $userId);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user