if ($client instanceof User) {
                // Create the session
                $data             = array();
                $data['username'] = (string)$client->username;
                $data['type']     = 'api';