Changeset

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
parents 10641:85f1cbfd364a
children 10643:417eadd0f567
files core/sessionmanager.lua
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
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