{"record":{"id":"ff50d7fc91960f8a","repo":"sickn33/agentic-awesome-skills","slug":"must-be-logged-in","errorCode":null,"errorMessage":"Must be logged in","messagePattern":"Must be logged in","errorType":"exception","errorClass":"AuthenticationError","httpStatus":401,"severity":"error","filePath":"skills/graphql/SKILL.md","lineNumber":718,"sourceCode":"Symptoms:\n- Unauthorized access to data\n- Business rules not enforced\n- Directive-only security bypassed\n\nWhy this breaks:\nDirectives are good for simple checks but can't handle complex\nbusiness logic. \"User can edit their own posts, or any post in\ngroups they moderate\" doesn't fit in a directive.\n\nRecommended fix:\n\n# AUTHORIZE IN RESOLVERS\n\n// Simple check in resolver\nMutation: {\n  deletePost: async (_, { id }, { user, db }) => {\n    if (!user) {\n      throw new AuthenticationError('Must be logged in');\n    }\n\n    const post = await db.post.findUnique({ where: { id } });\n\n    if (!post) {\n      throw new NotFoundError('Post not found');\n    }\n\n    // Business logic authorization\n    const canDelete =\n      post.authorId === user.id ||\n      user.role === 'ADMIN' ||\n      await userModeratesGroup(user.id, post.groupId);\n\n    if (!canDelete) {\n      throw new ForbiddenError('Cannot delete this post');\n    }\n","sourceCodeStart":700,"sourceCodeEnd":736,"githubUrl":"https://github.com/sickn33/agentic-awesome-skills/blob/58d857988fcfac6986206bca2b2fe223aa437e4b/skills/graphql/SKILL.md#L700-L736","documentation":"Error \"Must be logged in\" thrown in sickn33/agentic-awesome-skills.","triggerScenarios":"Thrown at skills/graphql/SKILL.md:718 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"58d857988fcfac6986206bca2b2fe223aa437e4b","analyzedAt":"2026-08-26T11:55:59.350Z","schemaVersion":2},"datasetVersion":"2026-08-26T14:46:13.012Z"}