{"record":{"id":"dd9ae2a4dc2001f7","repo":"gitroomhq/postiz-app","slug":"multiple-accounts-exist-for-this-email-different","errorCode":null,"errorMessage":"Multiple accounts exist for this email (different login providers)","messagePattern":"Multiple accounts exist for this email \\(different login providers\\)","errorType":"http","errorClass":"HttpException","httpStatus":400,"severity":"error","filePath":"libraries/nestjs-libraries/src/database/prisma/organizations/organization.service.ts","lineNumber":126,"sourceCode":"      org?.subscription?.subscriptionTier ||\n      (!process.env.STRIPE_PUBLISHABLE_KEY ? 'ULTIMATE' : 'FREE');\n\n    if (!pricing[tier].team_members) {\n      throw new HttpException(\n        'The organization plan does not include team members',\n        400\n      );\n    }\n\n    const users = await this._organizationRepository.getUsersByEmail(\n      body.email\n    );\n    if (!users.length) {\n      throw new HttpException('No Postiz account found for this email', 400);\n    }\n\n    if (users.length > 1) {\n      throw new HttpException(\n        'Multiple accounts exist for this email (different login providers)',\n        400\n      );\n    }\n\n    const [user] = users;\n\n    const userOrgs = await this._organizationRepository.getOrgsByUserId(\n      user.id\n    );\n    if (userOrgs.some((current) => current.id === org.id)) {\n      throw new HttpException(\n        'User is already a member of this organization',\n        400\n      );\n    }\n\n    const added = await this._organizationRepository.addUserToOrg(","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/gitroomhq/postiz-app/blob/0f1647f7491a217d43eb5ae7a480484bdf0aff3e/libraries/nestjs-libraries/src/database/prisma/organizations/organization.service.ts#L108-L144","documentation":"Thrown as HTTP 400 when the invited email matches more than one user account, which happens when the same email is registered through different login providers (e.g. Google OAuth and email/password). The system can't disambiguate which account to add.","triggerScenarios":"Calling addTeamMemberByEmail for an email that exists multiple times in the users table with different provider identifiers.","commonSituations":"Collaborator signed up with both Google SSO and credentials; legacy duplicate accounts after provider migrations; test environments with repeated seeded signups.","solutions":["Ask the user to remove or consolidate one of the duplicate accounts (delete the unused provider account)","As admin, merge or delete the duplicate user record in the database so only one remains","Invite using an email tied to a single account"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const users = await lookupUsersByEmail(email);\nif (users.length > 1) { askUserToPickAccountOrConsolidate(); return; }","typeGuard":"const isUniqueAccount = (users: User[]): users is [User] => users.length === 1;","tryCatchPattern":"try { await addTeamMember(orgId, email); } catch (e) { if (/Multiple accounts/.test(e.message)) { showMessage('Ask member to remove duplicate login'); return; } throw e; }","preventionTips":["Warn users not to register the same email via multiple providers","Deduplicate legacy accounts during provider migrations"],"tags":["team-members","duplicate-accounts","identity"],"backgroundTag":"ambiguous-user-identity","analyzedSha":"0f1647f7491a217d43eb5ae7a480484bdf0aff3e","analyzedAt":"2026-08-27T12:09:55.020Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}