{"record":{"id":"3f301ae94abc2f02","repo":"gitroomhq/postiz-app","slug":"registration-is-disabled","errorCode":null,"errorMessage":"Registration is disabled","messagePattern":"Registration is disabled","errorType":"error_code","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/backend/src/services/auth/auth.service.ts","lineNumber":56,"sourceCode":"    ip: string,\n    userAgent: string,\n    addToOrg?: boolean | { orgId: string; role: 'USER' | 'ADMIN'; id: string }\n  ) {\n    if (provider === Provider.LOCAL) {\n      if (process.env.DISALLOW_PLUS && body.email.includes('+')) {\n        throw new Error('Email with plus sign is not allowed');\n      }\n      if (body instanceof CreateOrgUserDto) {\n        body.email = body.email.toLowerCase();\n      }\n      const user = await this._userService.getUserByEmail(body.email);\n      if (body instanceof CreateOrgUserDto) {\n        if (user) {\n          throw new Error('Email already exists');\n        }\n\n        if (!(await this.canRegister(provider))) {\n          throw new Error('Registration is disabled');\n        }\n\n        const create = await this._organizationService.createOrgAndUser(\n          body,\n          ip,\n          userAgent\n        );\n\n        const addedOrg =\n          addToOrg && typeof addToOrg !== 'boolean'\n            ? await this._organizationService.addUserToOrg(\n                create.users[0].user.id,\n                addToOrg.id,\n                addToOrg.orgId,\n                addToOrg.role\n              )\n            : false;\n","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/gitroomhq/postiz-app/blob/0f1647f7491a217d43eb5ae7a480484bdf0aff3e/apps/backend/src/services/auth/auth.service.ts#L38-L74","documentation":"Registration gate checked during CreateOrgUserDto signup. canRegister(provider) returns false when the deployment's configuration disables new signups (e.g. registration disabled flag/env), so creating a new org+user is rejected.","triggerScenarios":"POST signup with a brand-new email while the registration-enabled setting is false; existing-user login is unaffected.","commonSituations":"Self-hosted instances or closed beta deployments where admin disabled registration via env/config and users still hit the public signup endpoint.","solutions":["Enable registration in the instance configuration (env/setting consumed by canRegister)","Use an invite/organization-add flow instead of public signup","If you are the admin, check the canRegister implementation for which flag controls it"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"const canRegister = await api.getRegistrationStatus();\nif (!canRegister) { throw new Error('Registration is closed on this server'); }","typeGuard":null,"tryCatchPattern":"try {\n  await signup(dto);\n} catch (err) {\n  if (err.message === 'Registration is disabled') { window.location.href = '/login'; }\n  throw err;\n}","preventionTips":["Gate signup UI on a registration-status endpoint","Fall back to invite/login flows when closed"],"tags":["auth","signup","registration-disabled","config"],"backgroundTag":"registration-disabled","analyzedSha":"0f1647f7491a217d43eb5ae7a480484bdf0aff3e","analyzedAt":"2026-08-27T12:09:55.020Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}