Skip to content

@mega-yfue/eufy-sdk / isNotAuthorized

Function: isNotAuthorized() ​

ts
function isNotAuthorized(err): boolean;

Whether a connect failed because the broker REFUSED the client — a CONNACK return code the client cannot retry its way out of, as mqtt.js words it (Connection refused: not authorized). A socket that dies without an answer is not this: it is the same request, unanswered, and retrying it is the only way to learn which of the two happened.

A refusal that arrives as a dropped connection instead of a CONNACK reads here as the transport failure it is indistinguishable from.

Parameters ​

err ​

unknown

Returns ​

boolean

Independent and unofficial. Not affiliated with, endorsed by, or sponsored by Anker Innovations, Anker eufy, or eufy. "Anker eufy", "eufy" and "Anker" are trademarks of their respective owners. Use responsibly — rapid or failed logins can trigger captcha or temporary cooldowns.