Diff

core/sessionmanager.lua @ 10642:de90b2f5da8c

sessionmanager: Support passing an auth scope to make_authenticated
author Matthew Wild <mwild1@gmail.com>
date Wed, 05 Feb 2020 17:56:20 +0000
parent 10378:04c4750ff8d2
child 11518:3f1a865e9419
line wrap: on
line diff
--- 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