delete session cookie when logging out and deleting account

This commit is contained in:
2025-05-28 14:39:36 +03:00
parent aa49d8e4b9
commit 8e646666d1
2 changed files with 11 additions and 4 deletions

View File

@ -126,8 +126,10 @@ app:post("user_delete", "/:username/delete", function(self)
return {redirect_to = self:url_for("user_delete_confirm", {username = me.username})}
end
local session = Sessions:find({key = self.session.session_key})
session:delete()
self.session.queue_delete = true
util.transfer_and_delete_user(target_user)
util.inject_infobox(self, "Your account has been added to the deletion queue.")
return {redirect_to = self:url_for("user_signup")}
end)
@ -379,7 +381,7 @@ app:post("user_logout", "/logout", function (self)
local session = Sessions:find({key = self.session.session_key})
session:delete()
self.session = nil
self.session.queue_delete = true
return {redirect_to = self:url_for("user_login")}
end)