Improve the events triggered on failed authentication
Trigger failed_auth as before, once for each failed method Trigger failed_all_auth once all method failed Trigger no_auth only if we couldn’t even try one method
This commit is contained in:
parent
73edd42774
commit
93934c7992
1 changed files with 5 additions and 2 deletions
|
@ -172,8 +172,11 @@ class FeatureMechanisms(BasePlugin):
|
||||||
min_mech=self.min_mech)
|
min_mech=self.min_mech)
|
||||||
except sasl.SASLNoAppropriateMechanism:
|
except sasl.SASLNoAppropriateMechanism:
|
||||||
log.error("No appropriate login method.")
|
log.error("No appropriate login method.")
|
||||||
|
self.xmpp.event("failed_all_auth")
|
||||||
|
if not self.attempted_mechs:
|
||||||
|
# Only trigger this event if we didn't try at least one
|
||||||
|
# method
|
||||||
self.xmpp.event("no_auth")
|
self.xmpp.event("no_auth")
|
||||||
self.xmpp.event("failed_auth")
|
|
||||||
self.attempted_mechs = set()
|
self.attempted_mechs = set()
|
||||||
return self.xmpp.disconnect()
|
return self.xmpp.disconnect()
|
||||||
except StringPrepError:
|
except StringPrepError:
|
||||||
|
|
Loading…
Reference in a new issue