{"record":{"id":"cb54210a778765b5","repo":"DIYgod/RSSHub","slug":"login-required","errorCode":null,"errorMessage":"Login required","messagePattern":"Login required","errorType":"exception","errorClass":null,"httpStatus":503,"severity":"error","filePath":"lib/routes-deprecated/dida365/habit-checkins.js","lineNumber":82,"sourceCode":"                        const record = records.habitRecords[checkin.habitId].find((re) => re.stamp === checkin.checkinStamp);\n                        return {\n                            title: `第${index + 1}天${info.name}打卡`,\n                            description: record && record.content,\n                            pubDate: `${(checkin.checkinStamp + '').slice(0, 4)}-${(checkin.checkinStamp + '').slice(4, 6)}-${(checkin.checkinStamp + '').slice(6, 8)}`,\n                            link: `https://dida365.com/webapp/#q/all/habit/${checkin.habitId}`,\n                            guid: checkin.id,\n                        };\n                    }),\n            ];\n        }\n\n        ctx.state.data = {\n            title: '滴答清单打卡',\n            link: 'https://dida365.com/webapp/#q/all/habit/',\n            item: list,\n        };\n    } else {\n        throw new Error('Login required');\n    }\n};\n","sourceCodeStart":64,"sourceCodeEnd":85,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes-deprecated/dida365/habit-checkins.js#L64-L85","documentation":"Thrown by the dida365 habit-checkins route when module-level `loginFlag` is falsy at request time. loginFlag becomes true only if config.dida365.username and password are both set AND the async login fired at module load eventually succeeds. Note the login is not awaited at request time, so a very early request can also see loginFlag undefined.","triggerScenarios":"DIDA365_USERNAME or DADA365_PASSWORD not configured; credentials wrong so the login promise rejects and logs 'Dida365 login fail.'; request arrives before the background login promise resolves; dida365 API temporarily unreachable at startup.","commonSituations":"Operator forgot to set the env vars; password rotated on dida365.com; instance restarted and the request hit within the login window; network egress to api.dida365.com blocked.","solutions":["Set both DIDA365_USERNAME and DIDA365_PASSWORD env vars and restart.","Check logs for 'Dida365 login fail.' and verify the credentials log in at dida365.com.","After restart, wait a moment for the background login to resolve before requesting the route.","Ensure outbound network to api.dida365.com is allowed."],"exampleFix":"# .env before\n# (nothing)\n# .env after\nDIDA365_USERNAME=your@email\nDIDA365_PASSWORD=yourpassword","handlingStrategy":"validation","validationCode":"const credsOk =\n  !!config.dida365?.username && !!config.dida365?.password;\nif (!credsOk) throw new Error('Login required');\n// plus: gate requests until the background login resolves\nif (!loginFlag) throw new Error('Login required');","typeGuard":"const hasDidaCreds = (c: any): boolean =>\n  !!c?.dida365?.username && !!c?.dida365?.password;","tryCatchPattern":null,"preventionTips":["Set both DIDA365 env vars before enabling the route.","Watch logs for 'Dida365 login fail.' on startup.","After restart, probe the route once before exposing it to readers."],"tags":["auth","config","routes","race-condition"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}