mod_storage_sql: Reconnect in all cases, and rollback on error.
[prosody.git] / util / sasl / scram.lua
index c846a7d12fb60f472b8007754b1394e67eb29675..530ef5a005614837b2edd440b9df120b8cc203a3 100644 (file)
@@ -143,7 +143,7 @@ local function scram_gen(hash_name, H_f, HMAC_f)
                        
                        -- retreive credentials
                        if self.profile.plain then
-                               local password, state = self.profile.plain(self.state.name, self.realm)
+                               local password, state = self.profile.plain(self, self.state.name, self.realm)
                                if state == nil then return "failure", "not-authorized"
                                elseif state == false then return "failure", "account-disabled" end
                                
@@ -163,7 +163,7 @@ local function scram_gen(hash_name, H_f, HMAC_f)
                                        return "failure", "temporary-auth-failure";
                                end
                        elseif self.profile["scram_"..hashprep(hash_name)] then
-                               local stored_key, server_key, iteration_count, salt, state = self.profile["scram_"..hashprep(hash_name)](self.state.name, self.realm);
+                               local stored_key, server_key, iteration_count, salt, state = self.profile["scram_"..hashprep(hash_name)](self, self.state.name, self.realm);
                                if state == nil then return "failure", "not-authorized"
                                elseif state == false then return "failure", "account-disabled" end