Software /
code /
prosody
File
util/sasl/external.lua @ 12549:3729a6bdb562 0.12
mod_smacks: Fix #1761 by setting a flag earlier
This ensures that the flag is set even if the pre-drain callback is
called from send(), as would be the case if opportunistic writes are
enabled.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 12 Jun 2022 01:50:33 +0200 |
parent | 8555:4f0f5b49bb03 |
child | 12975:d10957394a3c |
line wrap: on
line source
local saslprep = require "util.encodings".stringprep.saslprep; local _ENV = nil; -- luacheck: std none local function external(self, message) message = saslprep(message); local state self.username, state = self.profile.external(message); if state == false then return "failure", "account-disabled"; elseif state == nil then return "failure", "not-authorized"; elseif state == "expired" then return "false", "credentials-expired"; end return "success"; end local function init(registerMechanism) registerMechanism("EXTERNAL", {"external"}, external); end return { init = init; }