sessionmanager: Support passing an auth scope to make_authenticated
authorMatthew Wild <mwild1@gmail.com>
Wed, 05 Feb 2020 17:56:20 +0000
changeset 10646 de90b2f5da8c
parent 10645 85f1cbfd364a
child 10647 417eadd0f567
sessionmanager: Support passing an auth scope to make_authenticated
core/sessionmanager.lua
--- a/core/sessionmanager.lua	Wed Feb 05 17:41:40 2020 +0000
+++ b/core/sessionmanager.lua	Wed Feb 05 17:56:20 2020 +0000
@@ -122,13 +122,14 @@
 	retire_session(session);
 end
 
-local function make_authenticated(session, username)
+local function make_authenticated(session, username, scope)
 	username = nodeprep(username);
 	if not username or #username == 0 then return nil, "Invalid username"; end
 	session.username = username;
 	if session.type == "c2s_unauthed" then
 		session.type = "c2s_unbound";
 	end
+	session.auth_scope = scope;
 	session.log("info", "Authenticated as %s@%s", username, session.host or "(unknown)");
 	return true;
 end