mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-12-16 18:19:47 +05:30
Renamed some session methods to avoid conflicts with ORM methods
This commit is contained in:
parent
5f8ca89772
commit
3c7fe00130
@ -243,10 +243,10 @@ class AuthServer
|
|||||||
$authCode = SecureKey::make();
|
$authCode = SecureKey::make();
|
||||||
|
|
||||||
// Remove any old sessions the user might have
|
// Remove any old sessions the user might have
|
||||||
self::getStorage('session')->delete($authParams['client_id'], $type, $typeId);
|
self::getStorage('session')->deleteSession($authParams['client_id'], $type, $typeId);
|
||||||
|
|
||||||
// Create a new session
|
// Create a new session
|
||||||
$sessionId = self::getStorage('session')->create($authParams['client_id'], $authParams['redirect_uri'], $type, $typeId, $authCode);
|
$sessionId = self::getStorage('session')->createSession($authParams['client_id'], $authParams['redirect_uri'], $type, $typeId, $authCode);
|
||||||
|
|
||||||
// Associate scopes with the new session
|
// Associate scopes with the new session
|
||||||
foreach ($authParams['scopes'] as $scope)
|
foreach ($authParams['scopes'] as $scope)
|
||||||
|
@ -88,7 +88,7 @@ class AuthCode implements GrantTypeInterface {
|
|||||||
$accessTokenExpires = time() + AuthServer::getExpiresIn();
|
$accessTokenExpires = time() + AuthServer::getExpiresIn();
|
||||||
$accessTokenExpiresIn = AuthServer::getExpiresIn();
|
$accessTokenExpiresIn = AuthServer::getExpiresIn();
|
||||||
|
|
||||||
AuthServer::getStorage('session')->update(
|
AuthServer::getStorage('session')->updateSession(
|
||||||
$session['id'],
|
$session['id'],
|
||||||
null,
|
null,
|
||||||
$accessToken,
|
$accessToken,
|
||||||
|
@ -62,10 +62,10 @@ class ClientCredentials implements GrantTypeInterface {
|
|||||||
$accessTokenExpiresIn = AuthServer::getExpiresIn();
|
$accessTokenExpiresIn = AuthServer::getExpiresIn();
|
||||||
|
|
||||||
// Delete any existing sessions just to be sure
|
// Delete any existing sessions just to be sure
|
||||||
AuthServer::getStorage('session')->delete($authParams['client_id'], 'client', $authParams['client_id']);
|
AuthServer::getStorage('session')->deleteSession($authParams['client_id'], 'client', $authParams['client_id']);
|
||||||
|
|
||||||
// Create a new session
|
// Create a new session
|
||||||
AuthServer::getStorage('session')->create(
|
AuthServer::getStorage('session')->createSession(
|
||||||
$authParams['client_id'],
|
$authParams['client_id'],
|
||||||
null,
|
null,
|
||||||
'client',
|
'client',
|
||||||
|
@ -26,7 +26,7 @@ interface SessionInterface
|
|||||||
* @param string $stage The stage of the session (default ="request")
|
* @param string $stage The stage of the session (default ="request")
|
||||||
* @return int The session ID
|
* @return int The session ID
|
||||||
*/
|
*/
|
||||||
public function create(
|
public function createSession(
|
||||||
$clientId,
|
$clientId,
|
||||||
$redirectUri,
|
$redirectUri,
|
||||||
$type = 'user',
|
$type = 'user',
|
||||||
@ -56,7 +56,7 @@ interface SessionInterface
|
|||||||
* @param string $stage The stage of the session (default ="request")
|
* @param string $stage The stage of the session (default ="request")
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function update(
|
public function updateSession(
|
||||||
$sessionId,
|
$sessionId,
|
||||||
$authCode = null,
|
$authCode = null,
|
||||||
$accessToken = null,
|
$accessToken = null,
|
||||||
@ -78,7 +78,7 @@ interface SessionInterface
|
|||||||
* @param string $typeId The session owner's ID
|
* @param string $typeId The session owner's ID
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function delete(
|
public function deleteSession(
|
||||||
$clientId,
|
$clientId,
|
||||||
$type,
|
$type,
|
||||||
$typeId
|
$typeId
|
||||||
@ -100,7 +100,7 @@ interface SessionInterface
|
|||||||
* @return string|null Return the session ID as an integer if
|
* @return string|null Return the session ID as an integer if
|
||||||
* found otherwise returns false
|
* found otherwise returns false
|
||||||
*/
|
*/
|
||||||
public function exists(
|
public function sessionExists(
|
||||||
$type,
|
$type,
|
||||||
$typeId,
|
$typeId,
|
||||||
$clientId
|
$clientId
|
||||||
|
Loading…
Reference in New Issue
Block a user