@mega-yfue/eufy-sdk / LoginResult
Type Alias: LoginResult
ts
type LoginResult =
| {
session: MegaLoginResult;
status: typeof Ok;
}
| {
image: string;
retry: boolean;
status: typeof Captcha;
}
| {
method: string;
status: typeof TwoFactor;
};Outcome of login / continuation steps — a discriminated union so the caller switches on status instead of catching thrown errors for the expected captcha/2FA flow. Compare status against LoginStatus:
Ok— authenticated;sessioncarries the token.Captcha— solveimage(adata:image/png;base644-char challenge) and callsolveCaptcha(answer).retryis true when a prior answer was wrong.TwoFactor— a code was sent (methodsays how); callsubmitVerifyCode(code). ThecaptchaId/ pending-2FA token are held internally, so continuation methods take only the user-supplied answer/code.