Software /
code /
prosody
Comparison
plugins/mod_auth_internal_hashed.lua @ 3268:c1b687a5818d
mod_auth_internal_hashed: Don't assume user doesn't exist if no recognizable authentication data is found.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Tue, 15 Jun 2010 09:11:10 +0500 |
parent | 3267:8f5d76cc4162 |
child | 3269:342fd8f8ccd9 |
comparison
equal
deleted
inserted
replaced
3267:8f5d76cc4162 | 3268:c1b687a5818d |
---|---|
98 local account = datamanager.load(username, host, "accounts"); | 98 local account = datamanager.load(username, host, "accounts"); |
99 if not account then | 99 if not account then |
100 log("debug", "account not found for username '%s' at host '%s'", username, module.host); | 100 log("debug", "account not found for username '%s' at host '%s'", username, module.host); |
101 return nil, "Auth failed. Invalid username"; | 101 return nil, "Auth failed. Invalid username"; |
102 end | 102 end |
103 if (account.hashpass == nil or string.len(account.hashpass) == 0) and (account.password == nil or string.len(account.password) == 0) then | 103 --[[if (account.hashpass == nil or string.len(account.hashpass) == 0) and (account.password == nil or string.len(account.password) == 0) then |
104 log("debug", "account password not set or zero-length for username '%s' at host '%s'", username, module.host); | 104 log("debug", "account password not set or zero-length for username '%s' at host '%s'", username, module.host); |
105 return nil, "Auth failed. Password invalid."; | 105 return nil, "Auth failed. Password invalid."; |
106 end | 106 end]] |
107 return true; | 107 return true; |
108 end | 108 end |
109 | 109 |
110 function provider.create_user(username, password) | 110 function provider.create_user(username, password) |
111 local salt = generate_uuid(); | 111 local salt = generate_uuid(); |