Only send auth_text if it's not None (sasl)

This commit is contained in:
jesopo 2019-02-06 15:37:24 +00:00
parent be95514174
commit 0e63700761

View file

@ -89,10 +89,11 @@ class Module(ModuleManager.BaseModule):
else: else:
raise ValueError("unknown sasl mechanism '%s'" % mechanism) raise ValueError("unknown sasl mechanism '%s'" % mechanism)
if not auth_text == "+": if not auth_text == None:
auth_text = base64.b64encode(auth_text) if not auth_text == "+":
auth_text = auth_text.decode("utf8") auth_text = base64.b64encode(auth_text)
event["server"].send_authenticate(auth_text) auth_text = auth_text.decode("utf8")
event["server"].send_authenticate(auth_text)
def _end_sasl(self, server): def _end_sasl(self, server):
server.capability_done("sasl") server.capability_done("sasl")