@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