Software /
code /
prosody
Comparison
plugins/mod_saslauth.lua @ 10643:417eadd0f567
mod_saslauth: Pass through any auth scope from the SASL handler to sessionmanager.make_authenticated()
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Wed, 05 Feb 2020 17:56:44 +0000 |
parent | 10488:03ff1e614b4d |
child | 11214:5fb6563eee1e |
comparison
equal
deleted
inserted
replaced
10642:de90b2f5da8c | 10643:417eadd0f567 |
---|---|
47 local function handle_status(session, status, ret, err_msg) | 47 local function handle_status(session, status, ret, err_msg) |
48 if status == "failure" then | 48 if status == "failure" then |
49 module:fire_event("authentication-failure", { session = session, condition = ret, text = err_msg }); | 49 module:fire_event("authentication-failure", { session = session, condition = ret, text = err_msg }); |
50 session.sasl_handler = session.sasl_handler:clean_clone(); | 50 session.sasl_handler = session.sasl_handler:clean_clone(); |
51 elseif status == "success" then | 51 elseif status == "success" then |
52 local ok, err = sm_make_authenticated(session, session.sasl_handler.username); | 52 local ok, err = sm_make_authenticated(session, session.sasl_handler.username, session.sasl_handler.scope); |
53 if ok then | 53 if ok then |
54 module:fire_event("authentication-success", { session = session }); | 54 module:fire_event("authentication-success", { session = session }); |
55 session.sasl_handler = nil; | 55 session.sasl_handler = nil; |
56 session:reset_stream(); | 56 session:reset_stream(); |
57 else | 57 else |