Remove the middleware from the user controller file.

This commit is contained in:
Relintai 2022-07-22 09:47:24 +02:00
parent 30e3fd8faf
commit fa768d2474
2 changed files with 0 additions and 37 deletions

View File

@ -793,28 +793,3 @@ FormValidator *UserController::_profile_validator = nullptr;
String UserController::_path = "./";
String UserController::_table_name = "users";
// returnring true means handled, false means continue
bool UserSessionSetupMiddleware::on_before_handle_request_main(Request *request) {
if (request->session.is_valid()) {
int user_id = request->session->get_int("user_id");
if (user_id != 0) {
Ref<User> u = UserController::get_singleton()->db_get_user(user_id);
if (u.is_valid()) {
request->reference_data["user"] = u;
} else {
// log
request->session->remove("user_id");
}
}
}
return false;
}
UserSessionSetupMiddleware::UserSessionSetupMiddleware() {
}
UserSessionSetupMiddleware::~UserSessionSetupMiddleware() {
}

View File

@ -122,16 +122,4 @@ protected:
static String _table_name;
};
// just session setup
class UserSessionSetupMiddleware : public Middleware {
RCPP_OBJECT(UserSessionSetupMiddleware, Middleware);
public:
//returnring true means handled, false means continue
bool on_before_handle_request_main(Request *request);
UserSessionSetupMiddleware();
~UserSessionSetupMiddleware();
};
#endif