Software / code / prosody
Comparison
plugins/mod_saslauth.lua @ 1847:1842da566c7d
Merge with 0.5
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Tue, 29 Sep 2009 19:56:23 +0100 |
| parent | 1758:5acbf4318715 |
| parent | 1846:fdb43fc1bafc |
| child | 1912:126401a7159f |
comparison
equal
deleted
inserted
replaced
| 1845:e52dbae3c05d | 1847:1842da566c7d |
|---|---|
| 54 | 54 |
| 55 local function handle_status(session, status) | 55 local function handle_status(session, status) |
| 56 if status == "failure" then | 56 if status == "failure" then |
| 57 session.sasl_handler = nil; | 57 session.sasl_handler = nil; |
| 58 elseif status == "success" then | 58 elseif status == "success" then |
| 59 if not session.sasl_handler.username then -- TODO move this to sessionmanager | 59 local username = nodeprep(session.sasl_handler.username); |
| 60 session.sasl_handler = nil; | |
| 61 if not username then -- TODO move this to sessionmanager | |
| 60 module:log("warn", "SASL succeeded but we didn't get a username!"); | 62 module:log("warn", "SASL succeeded but we didn't get a username!"); |
| 61 session.sasl_handler = nil; | 63 session.sasl_handler = nil; |
| 62 session:reset_stream(); | 64 session:reset_stream(); |
| 63 return; | 65 return; |
| 64 end | 66 end |
| 65 sm_make_authenticated(session, session.sasl_handler.username); | 67 sm_make_authenticated(session, username); |
| 66 session.sasl_handler = nil; | |
| 67 session:reset_stream(); | 68 session:reset_stream(); |
| 68 end | 69 end |
| 69 end | 70 end |
| 70 | 71 |
| 71 local function credentials_callback(mechanism, ...) | 72 local function credentials_callback(mechanism, ...) |