Software /
code /
prosody
Comparison
plugins/mod_legacyauth.lua @ 891:236d1ce9fa99
mod_legacyauth: Added stream feature: <auth xmlns='http://jabber.org/features/iq-auth'/>
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Sun, 08 Mar 2009 04:49:51 +0500 |
parent | 760:90ce865eebd8 |
child | 896:2c0b9e3c11c3 |
comparison
equal
deleted
inserted
replaced
890:5b8da51b0843 | 891:236d1ce9fa99 |
---|---|
10 | 10 |
11 local st = require "util.stanza"; | 11 local st = require "util.stanza"; |
12 local t_concat = table.concat; | 12 local t_concat = table.concat; |
13 | 13 |
14 module:add_feature("jabber:iq:auth"); | 14 module:add_feature("jabber:iq:auth"); |
15 module:add_event_hook("stream-features", function (session, features) | |
16 if not session.username then features:tag("auth", {xmlns='http://jabber.org/features/iq-auth'}):up(); end | |
17 end); | |
15 | 18 |
16 module:add_iq_handler("c2s_unauthed", "jabber:iq:auth", | 19 module:add_iq_handler("c2s_unauthed", "jabber:iq:auth", |
17 function (session, stanza) | 20 function (session, stanza) |
18 local username = stanza.tags[1]:child_with_name("username"); | 21 local username = stanza.tags[1]:child_with_name("username"); |
19 local password = stanza.tags[1]:child_with_name("password"); | 22 local password = stanza.tags[1]:child_with_name("password"); |