Comparison

core/sessionmanager.lua @ 10043:ce8e18f20693

core/sessionmanager: Remove unnecessary fallback in make_authenticated
author Maxime “pep” Buquet <pep@bouah.net>
date Sat, 01 Jun 2019 15:00:35 +0200
parent 9937:6245ee9494c6
child 10105:63f87211fcdd
comparison
equal deleted inserted replaced
10042:4e63e28ba362 10043:ce8e18f20693
127 if not username or #username == 0 then return nil, "Invalid username"; end 127 if not username or #username == 0 then return nil, "Invalid username"; end
128 session.username = username; 128 session.username = username;
129 if session.type == "c2s_unauthed" then 129 if session.type == "c2s_unauthed" then
130 session.type = "c2s_unbound"; 130 session.type = "c2s_unbound";
131 end 131 end
132 session.log("info", "Authenticated as %s@%s", username or "(unknown)", session.host or "(unknown)"); 132 session.log("info", "Authenticated as %s@%s", username, session.host or "(unknown)");
133 return true; 133 return true;
134 end 134 end
135 135
136 -- returns true, nil on success 136 -- returns true, nil on success
137 -- returns nil, err_type, err, err_message on failure 137 -- returns nil, err_type, err, err_message on failure