util.session: Fix session id not include unauthed forever

This commit is contained in:
Kim Alvefur 2019-04-03 17:20:57 +02:00
parent 049663349e
commit 392eac3c62

View file

@ -4,12 +4,13 @@ local logger = require "util.logger";
local function new_session(typ) local function new_session(typ)
local session = { local session = {
type = typ .. "_unauthed"; type = typ .. "_unauthed";
base_type = typ;
}; };
return session; return session;
end end
local function set_id(session) local function set_id(session)
local id = session.type .. tostring(session):match("%x+$"):lower(); local id = session.base_type .. tostring(session):match("%x+$"):lower();
session.id = id; session.id = id;
return session; return session;
end end