Skip to content
Snippets Groups Projects
Commit 09e86b72 authored by Fabian de Rijk's avatar Fabian de Rijk
Browse files

Removed cookie auth

parent 8d6da5ed
No related branches found
No related tags found
No related merge requests found
......@@ -94,13 +94,6 @@ class AuthenticationService implements AuthenticationServiceInterface {
*/
private $authValues = [];
/**
* If we want to save the auth as a cookie.
*
* @var bool
*/
public $useCookieAuth = FALSE;
/**
* The current user account.
*
......@@ -252,20 +245,6 @@ class AuthenticationService implements AuthenticationServiceInterface {
return FALSE;
}
/**
* {@inheritdoc}
*/
public function saveAuthDataFromCookie() {
$authCookie = $_COOKIE[$this->constants->getUserTempStoreDataName()];
$authValues = json_decode($authCookie, TRUE);
// Save the data and delete the cookie.
$this->saveDataToTempStore($this->constants->getUserTempStoreDataName(), $authValues);
setcookie($this->constants->getUserTempStoreDataName(), '', time() - 3600);
$this->useCookieAuth = FALSE;
}
/**
* {@inheritdoc}
*/
......@@ -342,11 +321,6 @@ class AuthenticationService implements AuthenticationServiceInterface {
* The saved auth data.
*/
private function getAuthData() {
if ($this->useCookieAuth) {
$authCookie = $_COOKIE[$this->constants->getUserTempStoreDataName()];
return json_decode($authCookie, TRUE);
}
// Check if there is some auth data on the url, if so, save it.
if (!empty($this->request->get('access_token'))) {
$this->saveAuthDataFromUrl();
......@@ -377,7 +351,6 @@ class AuthenticationService implements AuthenticationServiceInterface {
}
$this->saveDataToTempStore($this->constants->getUserTempStoreDataName(), $this->authValues);
setcookie($this->constants->getUserTempStoreDataName(), json_encode($this->authValues), $this->constants->getCookieExpire(), '/');
}
/**
......
......@@ -51,13 +51,6 @@ interface AuthenticationServiceInterface {
*/
public function getAccessToken($login = FALSE);
/**
* Save the auth data from the cookie in the user session storage.
*
* @throws \Drupal\Core\TempStore\TempStoreException
*/
public function saveAuthDataFromCookie();
/**
* Save the auth data from the url parameters in the user session storage.
*
......
......@@ -156,16 +156,6 @@ class ConstantsService {
return $this->userTempStoreDataName;
}
/**
* Get the cookie expire timestamp.
*
* @return int
* The expire timestamp.
*/
public function getCookieExpire() {
return time() + 3600;
}
/**
* Get the tenant ID.
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment