diff --git a/app/library/Auth.php b/app/library/Auth.php index 33730ab..ade7a70 100644 --- a/app/library/Auth.php +++ b/app/library/Auth.php @@ -9,10 +9,7 @@ use App\Model\Data\User, class Auth extends Component { - /** - * @var string - */ - protected $_session_key = 'auth'; + const SESSION_KEY = 'auth'; /** * Login using email/user + password combination. @@ -92,7 +89,7 @@ class Auth extends Component */ public function setIdentity($identity) { - $this->session->set($this->_session_key, $identity); + $this->session->set(self::SESSION_KEY, $identity); return $this; } @@ -101,7 +98,7 @@ class Auth extends Component */ public function getIdentity() { - $id = $this->session->get($this->_session_key); + $id = $this->session->get(self::SESSION_KEY); if ($id !== null) { return User::findFirst($id); @@ -116,7 +113,7 @@ class Auth extends Component { if ($this->hasIdentity()) { - $id = $this->session->get($this->_session_key); + $id = $this->session->get(self::SESSION_KEY); return User::findFirst($id); } @@ -128,8 +125,6 @@ class Auth extends Component return $this->getIdentity() !== NULL; } - - /** * Clears the identity information. * @@ -137,7 +132,7 @@ class Auth extends Component */ public function clearIdentity() { - $this->session->remove($this->_session_key); + $this->session->remove(self::SESSION_KEY); return $this; } }