Software /
code /
prosody
Changeset
3236:4727b2b0e069
sessionmanager: Moved nodeprep to sessionmanager.make_authenticated.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Fri, 11 Jun 2010 20:34:00 +0500 |
parents | 3233:8f78e8164032 |
children | 3237:721a83a3beb9 |
files | core/sessionmanager.lua |
diffstat | 1 files changed, 3 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/core/sessionmanager.lua Fri Jun 11 14:25:22 2010 +0100 +++ b/core/sessionmanager.lua Fri Jun 11 20:34:00 2010 +0500 @@ -25,6 +25,7 @@ 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 @@ 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";