src/Auth/AuthAPI.php
public function authenticate() {
        if ($this->token != "") {
            $userInfo = $this->checkIfTokenIsValidAndUpdateTheExpireDate();
        } else { //Is a guess user.
            $userInfo = ['username' => 'guest', 'name' => 'guest', 'id_user' => 1];
        }

        $this->setUsername($userInfo['username']);
        $this->setRoleName($userInfo['name']);
        $this->setUserId($userInfo['id_user']);
        $this->setDefaultLanguage($userInfo['id_user']);
    }
public function authenticate() {
        if ($this->token != "") {
            $userInfo = $this->checkIfTokenIsValidAndUpdateTheExpireDate();
        } else { //Is a guess user.
            $userInfo = ['username' => 'guest', 'name' => 'guest', 'id_user' => 1];
        }

        $this->setUsername($userInfo['username']);
        $this->setRoleName($userInfo['name']);
        $this->setUserId($userInfo['id_user']);
        $this->setDefaultLanguage($userInfo['id_user']);
    }
Logic of authentication.

@return void