{"record":{"id":"9c3cae125c3b18cf","repo":"RocketChat/Rocket.Chat","slug":"error-user-registration-disabled","errorCode":"error-user-registration-disabled","errorMessage":"User registration is disabled","messagePattern":"User registration is disabled","errorType":"exception","errorClass":"Meteor.Error","httpStatus":null,"severity":"error","filePath":"apps/meteor/server/meteor-methods/users/registerUser.ts","lineNumber":72,"sourceCode":"\n\t\tconst stampedLoginToken = await Accounts._generateStampedLoginToken();\n\n\t\tawait Accounts._insertLoginToken(userId, stampedLoginToken);\n\t\treturn stampedLoginToken;\n\t}\n\tcheck(\n\t\tformData,\n\t\tMatch.ObjectIncluding({\n\t\t\temail: String,\n\t\t\tpass: String,\n\t\t\tname: String,\n\t\t\tsecretURL: Match.Optional(String),\n\t\t\treason: Match.Optional(String),\n\t\t}),\n\t);\n\n\tif (settings.get('Accounts_RegistrationForm') === 'Disabled') {\n\t\tthrow new Meteor.Error('error-user-registration-disabled', 'User registration is disabled', {\n\t\t\tmethod: 'registerUser',\n\t\t});\n\t}\n\n\tif (\n\t\tsettings.get('Accounts_RegistrationForm') === 'Secret URL' &&\n\t\t(!formData.secretURL || formData.secretURL !== settings.get('Accounts_RegistrationForm_SecretURL'))\n\t) {\n\t\tif (!formData.secretURL) {\n\t\t\tthrow new Meteor.Error('error-user-registration-secret', 'User registration is only allowed via Secret URL', {\n\t\t\t\tmethod: 'registerUser',\n\t\t\t});\n\t\t}\n\n\t\ttry {\n\t\t\tawait validateInviteToken(formData.secretURL);\n\t\t} catch (e) {\n\t\t\tthrow new Meteor.Error('error-user-registration-secret', 'User registration is only allowed via Secret URL', {","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/server/meteor-methods/users/registerUser.ts#L54-L90","documentation":"Thrown by the 'registerUser' Meteor method (shared by POST /api/v1/users.register) when the server setting Accounts_RegistrationForm is set to 'Disabled'. The server rejects every self-registration attempt before validating the payload. This is an intentional workspace policy gate, not a bug: the admin explicitly closed public signup.","triggerScenarios":"Calling Meteor.callAsync('registerUser', { email, pass, name }) or POST /api/v1/users.register on a workspace where Administration > Accounts > Registration Form is 'Disabled'. Also triggered by deploy/test scripts or e2e tests that register users against a server whose registration form was disabled after setup.","commonSituations":"Enterprises that provision users via LDAP/SAML/OAuth and disable public signup; staging servers cloned from hardened production config; CI tests written when registration was open, later failing after an admin flipped the setting.","solutions":["If self-registration should work: as admin, set Administration > Accounts > Registration Form to 'Public' or 'Secret URL' and retry.","If registration must stay closed: create users with an admin-authenticated POST /api/v1/users.create (or use the invite flow) instead of registerUser.","Verify you are pointed at the intended workspace (wrong SERVER_URL / reverse proxy often hits a hardened instance)."],"exampleFix":"// before: self-registration against a server with registration Disabled\nawait Meteor.callAsync('registerUser', { email, pass, name }); // throws error-user-registration-disabled\n\n// after: provision via admin REST endpoint\nawait fetch('/api/v1/users.create', {\n  method: 'POST',\n  headers: { 'X-Auth-Token': adminToken, 'X-User-Id': adminUid, 'Content-Type': 'application/json' },\n  body: JSON.stringify({ email, password: pass, username, name }),\n});","handlingStrategy":"try-catch","validationCode":"const resp = await fetch('/api/v1/settings.public');\nconst { settings } = await resp.json();\nconst regForm = settings.Accounts_RegistrationForm; // 'Public' | 'Secret URL' | 'Disabled'\nif (regForm === 'Disabled') {\n  hideSelfRegistrationUI();\n}","typeGuard":null,"tryCatchPattern":"try {\n  await Meteor.callAsync('registerUser', formData);\n} catch (e) {\n  if ((e as Meteor.Error).error === 'error-user-registration-disabled') {\n    showNotice('Registration is closed on this server. Ask an admin for an account.');\n    return;\n  }\n  throw e;\n}","preventionTips":["Read the public Accounts_RegistrationForm setting before rendering the signup form","Surface a 'registration closed' state instead of a failing form submission","In CI, assert the workspace registration mode before running signup tests"],"tags":["registration","accounts","settings","meteor-method"],"backgroundTag":"user-registration-disabled","analyzedSha":"b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0","analyzedAt":"2026-08-18T15:26:39.429Z","contentChangedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}