aboutsummaryrefslogtreecommitdiffstats
path: root/core/sessionmanager.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-12-13 18:15:17 +0100
committerKim Alvefur <zash@zash.se>2016-12-13 18:15:17 +0100
commite701756ba976c28d2532f3d113f24429c457dec5 (patch)
treea9e59e3c8fba4c4967beb53eb5690135075ae802 /core/sessionmanager.lua
parent0f0d87f07b8d6e9109b5fb3358078c663beab4d5 (diff)
downloadprosody-e701756ba976c28d2532f3d113f24429c457dec5.tar.gz
prosody-e701756ba976c28d2532f3d113f24429c457dec5.zip
core.sessionmanager, mod_saslauth: Introduce intermediate session type for authenticated but unbound sessions so that resource binding is not treated as a normal stanza
Diffstat (limited to 'core/sessionmanager.lua')
-rw-r--r--core/sessionmanager.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/sessionmanager.lua b/core/sessionmanager.lua
index c8856634..75e54b4f 100644
--- a/core/sessionmanager.lua
+++ b/core/sessionmanager.lua
@@ -108,7 +108,7 @@ local function make_authenticated(session, 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";
+ session.type = "c2s_unbound";
end
session.log("info", "Authenticated as %s@%s", username or "(unknown)", session.host or "(unknown)");
return true;
@@ -176,6 +176,9 @@ local function bind_resource(session, resource)
session.full_jid = session.username .. '@' .. session.host .. '/' .. resource;
hosts[session.host].sessions[session.username].sessions[resource] = session;
full_sessions[session.full_jid] = session;
+ if session.type == "c2s_unbound" then
+ session.type = "c2s";
+ end
local err;
session.roster, err = rm_load_roster(session.username, session.host);