Software / code / prosody
Comparison
plugins/mod_auth_anonymous.lua @ 4944:72a2eec4204a
mod_auth_anonymous: Attach a fake roster to the session, so the null storage backend can be used
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sat, 07 Jul 2012 03:42:31 +0200 |
| parent | 4846:3bc3498df0a0 |
| child | 4947:6d9317ea79b2 |
comparison
equal
deleted
inserted
replaced
| 4943:50f63f07245f | 4944:72a2eec4204a |
|---|---|
| 30 | 30 |
| 31 function provider.create_user(username, password) | 31 function provider.create_user(username, password) |
| 32 return nil, "Account creation/modification not supported."; | 32 return nil, "Account creation/modification not supported."; |
| 33 end | 33 end |
| 34 | 34 |
| 35 function provider.get_sasl_handler() | 35 function provider.get_sasl_handler(session) |
| 36 local anonymous_authentication_profile = { | 36 local anonymous_authentication_profile = { |
| 37 anonymous = function(sasl, username, realm) | 37 anonymous = function(sasl, username, realm) |
| 38 session.roster = {}; -- so that the null storage backend doesn't upset rostermanager | |
| 38 return true; -- for normal usage you should always return true here | 39 return true; -- for normal usage you should always return true here |
| 39 end | 40 end |
| 40 }; | 41 }; |
| 41 return new_sasl(module.host, anonymous_authentication_profile); | 42 return new_sasl(module.host, anonymous_authentication_profile); |
| 42 end | 43 end |