aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2020-02-05 17:56:20 +0000
committerMatthew Wild <mwild1@gmail.com>2020-02-05 17:56:20 +0000
commit783af2135e96ad2af8325a32f7f06f7cf51642db (patch)
tree61142e3ae85975ec38b07d6491718c1b8857ebe1 /core
parente4f830812fe66033ad1344795def93537d159d62 (diff)
downloadprosody-783af2135e96ad2af8325a32f7f06f7cf51642db.tar.gz
prosody-783af2135e96ad2af8325a32f7f06f7cf51642db.zip
sessionmanager: Support passing an auth scope to make_authenticated
Diffstat (limited to 'core')
-rw-r--r--core/sessionmanager.lua3
1 files changed, 2 insertions, 1 deletions
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