util.sasl.oauthbearer: Fix traceback on authz in unexpected format

E.g. if you were to just pass "username" without @hostname, the split
will return nil, "username" and the nil gets passed to saslprep() and it
does not like that.
pull/27/head
Kim Alvefur 3 years ago
parent 9e02d322d8
commit aabfdaf01a
  1. 4
      util/sasl/oauthbearer.lua

@ -34,6 +34,10 @@ local function oauthbearer(self, message)
local username = jid.prepped_split(gs2_authzid);
if not username or username == "" then
return "failure", "malformed-request", "Expected authorization identity in the username@hostname format";
end
-- SASLprep username
username = saslprep(username);

Loading…
Cancel
Save