33 |
33 |
34 local function handle_status(session, status) |
34 local function handle_status(session, status) |
35 if status == "failure" then |
35 if status == "failure" then |
36 session.sasl_handler = nil; |
36 session.sasl_handler = nil; |
37 elseif status == "success" then |
37 elseif status == "success" then |
|
38 if not session.sasl_handler.username then error("SASL succeeded but we didn't get a username!"); end -- TODO move this to sessionmanager |
|
39 sessionmanager.make_authenticated(session, session.sasl_handler.username); |
38 session.sasl_handler = nil; |
40 session.sasl_handler = nil; |
39 session:reset_stream(); |
41 session:reset_stream(); |
40 end |
42 end |
41 end |
43 end |
42 |
44 |