Reimplemented UserLogoutWebPage.

This commit is contained in:
Relintai 2022-07-23 22:37:21 +02:00
parent 299f714ed9
commit ae36b35436
2 changed files with 6 additions and 2 deletions

View File

@ -14,7 +14,11 @@
#include "modules/web/http/web_server_cookie.h"
#include "modules/web/http/web_server_request.h"
void UserLogoutWebPage::handle_logout_request(Ref<User> &user, Ref<WebServerRequest> request) {
void UserLogoutWebPage::_render_index(Ref<WebServerRequest> request) {
Ref<User> user = request->get_meta("user");
ERR_FAIL_COND(!user.is_valid());
request->response_remove_cookie_simple("session_id");
user->save();

View File

@ -15,7 +15,7 @@ class UserLogoutWebPage : public UserWebPage {
GDCLASS(UserLogoutWebPage, UserWebPage);
public:
virtual void handle_logout_request(Ref<User> &user, Ref<WebServerRequest> request);
void _render_index(Ref<WebServerRequest> request);
UserLogoutWebPage();
~UserLogoutWebPage();