{"record":{"id":"76b285e864c75dbf","repo":"AlexxIT/go2rtc","slug":"wyze-no-access-token-in-response","errorCode":null,"errorMessage":"wyze: no access token in response","messagePattern":"wyze: no access token in response","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/wyze/cloud.go","lineNumber":145,"sourceCode":"\tif errResp.hasError() {\n\t\treturn fmt.Errorf(\"wyze: login failed (code %s): %s\", errResp.code(), errResp.message())\n\t}\n\n\tvar result loginResponse\n\tif err := json.Unmarshal(body, &result); err != nil {\n\t\treturn fmt.Errorf(\"wyze: failed to parse login response: %w\", err)\n\t}\n\n\tif len(result.MFAOptions) > 0 {\n\t\treturn &AuthError{\n\t\t\tMessage:  \"MFA required\",\n\t\t\tNeedsMFA: true,\n\t\t\tMFAType:  strings.Join(result.MFAOptions, \",\"),\n\t\t}\n\t}\n\n\tif result.AccessToken == \"\" {\n\t\treturn errors.New(\"wyze: no access token in response\")\n\t}\n\n\tc.accessToken = result.AccessToken\n\n\treturn nil\n}\n\nfunc (c *Cloud) GetCameraList() ([]*Camera, error) {\n\tpayload := map[string]any{\n\t\t\"access_token\":      c.accessToken,\n\t\t\"phone_id\":          c.phoneID,\n\t\t\"app_name\":          appName,\n\t\t\"app_ver\":           appName + \"___\" + appVersion,\n\t\t\"app_version\":       appVersion,\n\t\t\"phone_system_type\": 1,\n\t\t\"sc\":                \"9f275790cab94a72bd206c8876429f3c\",\n\t\t\"sv\":                \"9d74946e652647e9b6c9d59326aef104\",\n\t\t\"ts\":                time.Now().UnixMilli(),","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/AlexxIT/go2rtc/blob/c245815e75e2a5fd60b4290f12bfc04e55a984d3/pkg/wyze/cloud.go#L127-L163","documentation":"pkg/wyze cloud Login performs the Wyze OAuth-style login and expects the response to contain an access token. When the API responds successfully (no MFA required, HTTP OK) but result.AccessToken is empty, the client treats the response as useless and returns this error before storing the token.","triggerScenarios":"Calling wyze Login (or LoginWithCaptcha) with credentials the Wyze cloud accepts but which do not yield a token — typically when the API returned an unexpected/undocumented success payload, e.g. an account requiring further verification the client didn't detect.","commonSituations":"Wyze changing their login API response shape; accounts flagged and returning empty tokens; wrong API base URL or region; a proxy/interception stripping the token field.","solutions":["Verify Wyze account credentials and that the account is not locked or requiring re-verification in the Wyze app","Log/inspect the full login response to see what the cloud actually returned","Confirm you are using a current version of the library matching the live Wyze API","Try login with MFA handling enabled (LoginWithCaptcha) in case MFA detection failed"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := cloud.Login(user, pass); err != nil {\n    if strings.Contains(err.Error(), \"no access token\") {\n        // surface account-verification guidance or retry with MFA flow\n    }\n    return err\n}","preventionTips":["Keep the wyze client library updated against API changes","Verify account status in the Wyze app before programmatic login","Enable MFA-aware login flows (captcha/MFA)"],"tags":["wyze","cloud","auth","api"],"backgroundTag":"unexpected-api-response-shape","analyzedSha":"c245815e75e2a5fd60b4290f12bfc04e55a984d3","analyzedAt":"2026-09-07T11:47:02.965Z","contentChangedAt":"2026-09-07T11:47:02.965Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}