diff --git a/modules/users/user.cpp b/modules/users/user.cpp index 452fefd..38ccebb 100644 --- a/modules/users/user.cpp +++ b/modules/users/user.cpp @@ -118,15 +118,6 @@ std::string User::to_json(rapidjson::Document *into) { document->AddMember("password_reset_token", rapidjson::Value(password_reset_token.c_str(), document->GetAllocator()), document->GetAllocator()); document->AddMember("locked", locked, document->GetAllocator()); - rapidjson::Value sa(rapidjson::Type::kArrayType); - rapidjson::Document::AllocatorType &allocator = document->GetAllocator(); - - for (int i = 0; i < sessions.size(); i++) { - sa.PushBack(rapidjson::Value(sessions[i].c_str(), document->GetAllocator()), allocator); - } - - document->AddMember("sessions", sa, document->GetAllocator()); - if (into) { return ""; } @@ -159,12 +150,6 @@ void User::from_json(const std::string &p_data) { password_reset_token = uobj["password_reset_token"].GetString(); locked = uobj["locked"].GetBool(); - - const rapidjson::Value &sess = uobj["sessions"].GetArray(); - - for (rapidjson::Value::ConstValueIterator itr = sess.Begin(); itr != sess.End(); ++itr) { - sessions.push_back(itr->GetString()); - } } User::User() : diff --git a/modules/users/user.h b/modules/users/user.h index 949a516..2b790f8 100644 --- a/modules/users/user.h +++ b/modules/users/user.h @@ -5,7 +5,6 @@ #include #include -#include class Request; class FormValidator; @@ -21,7 +20,6 @@ public: std::string post_salt; std::string password_hash; bool banned; - std::vector sessions; std::string password_reset_token; bool locked; diff --git a/modules/users/user_controller.cpp b/modules/users/user_controller.cpp index 0e45e1e..2b5ca2d 100644 --- a/modules/users/user_controller.cpp +++ b/modules/users/user_controller.cpp @@ -407,13 +407,6 @@ void UserController::handle_password_reset_request(Ref &user, Request *req void UserController::handle_logout_request(Ref &user, Request *request) { request->remove_cookie("session_id"); - for (int i = 0; i < user->sessions.size(); ++i) { - if (user->sessions[i] == request->session->session_id) { - user->sessions[i] = user->sessions[user->sessions.size() - 1]; - user->sessions.pop_back(); - } - } - UserModel::get_singleton()->save_user(user); SessionManager::get_singleton()->delete_session(request->session->session_id);