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