diff options
author | Waqas Hussain <waqas20@gmail.com> | 2010-06-11 20:34:00 +0500 |
---|---|---|
committer | Waqas Hussain <waqas20@gmail.com> | 2010-06-11 20:34:00 +0500 |
commit | a6d821d5d6cdb8b37e746c3f56b20c84f989e170 (patch) | |
tree | d0260b6393bbe893283a1a7188aec4baf7d09519 | |
parent | 679ffe558d88122efd48da1ca3faf8d2f06ca0cd (diff) | |
download | prosody-a6d821d5d6cdb8b37e746c3f56b20c84f989e170.tar.gz prosody-a6d821d5d6cdb8b37e746c3f56b20c84f989e170.zip |
sessionmanager: Moved nodeprep to sessionmanager.make_authenticated.
-rw-r--r-- | core/sessionmanager.lua | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/core/sessionmanager.lua b/core/sessionmanager.lua index fd6ed96e..db32a0bc 100644 --- a/core/sessionmanager.lua +++ b/core/sessionmanager.lua @@ -25,6 +25,7 @@ local rm_load_roster = require "core.rostermanager".load_roster; local config_get = require "core.configmanager".get; local nameprep = require "util.encodings".stringprep.nameprep; local resourceprep = require "util.encodings".stringprep.resourceprep; +local nodeprep = require "util.encodings".stringprep.nodeprep; local fire_event = require "core.eventmanager".fire_event; local add_task = require "util.timer".add_task; @@ -109,6 +110,8 @@ function destroy_session(session, err) end function make_authenticated(session, username) + username = nodeprep(username); + if not username and #username > 0 then return nil, "Invalid username"; end session.username = username; if session.type == "c2s_unauthed" then session.type = "c2s"; |