From 783af2135e96ad2af8325a32f7f06f7cf51642db Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Wed, 5 Feb 2020 17:56:20 +0000 Subject: sessionmanager: Support passing an auth scope to make_authenticated --- core/sessionmanager.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/sessionmanager.lua b/core/sessionmanager.lua index 6c005fcd..eb515819 100644 --- a/core/sessionmanager.lua +++ b/core/sessionmanager.lua @@ -122,13 +122,14 @@ local function destroy_session(session, err) 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 -- cgit v1.2.3