{"record":{"id":"bc0135fd7856504b","repo":"RocketChat/Rocket.Chat","slug":"error-name-param-not-provided","errorCode":"error-name-param-not-provided","errorMessage":"The parameter \"name\" is required","messagePattern":"The parameter \"name\" is required","errorType":"exception","errorClass":"Meteor.Error","httpStatus":400,"severity":"error","filePath":"apps/meteor/server/api/v1/settings.ts","lineNumber":250,"sourceCode":"\t\t\tPOST: { permissions: ['add-oauth-service'], operation: 'hasAll' },\n\t\t},\n\t\tbody: addCustomOAuthBodySchema,\n\t\tresponse: {\n\t\t\t200: ajv.compile<void>({\n\t\t\t\ttype: 'object',\n\t\t\t\tproperties: { success: { type: 'boolean', enum: [true] } },\n\t\t\t\trequired: ['success'],\n\t\t\t\tadditionalProperties: false,\n\t\t\t}),\n\t\t\t400: validateBadRequestErrorResponse,\n\t\t\t401: validateUnauthorizedErrorResponse,\n\t\t\t403: validateForbiddenErrorResponse,\n\t\t},\n\t},\n\tasync function action() {\n\t\tconst { name } = this.bodyParams;\n\t\tif (!name?.trim()) {\n\t\t\tthrow new Meteor.Error('error-name-param-not-provided', 'The parameter \"name\" is required');\n\t\t}\n\n\t\tawait addOAuthServiceMethod(this.userId, name);\n\n\t\treturn API.v1.success();\n\t},\n);\n\nAPI.v1.post(\n\t'settings.removeCustomOAuth',\n\t{\n\t\tauthRequired: true,\n\t\ttwoFactorRequired: true,\n\t\tpermissionsRequired: {\n\t\t\tPOST: { permissions: ['add-oauth-service'], operation: 'hasAll' },\n\t\t},\n\t\tbody: addCustomOAuthBodySchema,\n\t\tresponse: {","sourceCodeStart":232,"sourceCodeEnd":268,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/f9d3ec372bb580fa8d036f94cf03925a478ef768/apps/meteor/server/api/v1/settings.ts#L232-L268","documentation":"Thrown by POST settings.addCustomOAuth when the body 'name' field is missing or whitespace-only. The route registers a new custom OAuth provider by name; without a name there's nothing to register. Note this route is twoFactorRequired and gated to admins.","triggerScenarios":"POST /api/v1/settings.addCustomOAuth with an empty/missing/whitespace 'name' in the body.","commonSituations":"Automation that forgot to template the name; trailing-space-only value; form submitted with empty provider name.","solutions":["Send a non-empty trimmed 'name' (e.g. 'google', 'github') in the body.","Validate name.trim() on the client before submitting.","Use a known provider key matching the OAuth app config you intend to fill in afterwards."],"exampleFix":"// before\nawait rest.post('/api/v1/settings.addCustomOAuth', { name: '' });\n\n// after\nconst name = 'google';\nif (!name.trim()) throw new Error('OAuth provider name required');\nawait rest.post('/api/v1/settings.addCustomOAuth', { name });","handlingStrategy":"validation","validationCode":"const name = (body.name ?? '').toString().trim();\nif (!name) throw new Error('OAuth provider name required');\nawait rest.post('/api/v1/settings.addCustomOAuth', { name });","typeGuard":"function isNonEmptyName(s: unknown): s is string {\n  return typeof s === 'string' && s.trim().length > 0;\n}","tryCatchPattern":"try {\n  await rest.post('/api/v1/settings.addCustomOAuth', { name });\n} catch (e) {\n  if (isMeteorError(e, 'error-name-param-not-provided')) {\n    notify('Provider name is required.');\n  } else throw e;\n}","preventionTips":["Trim and validate name client-side.","Use a recognized provider key.","Disable submit while the name field is empty."],"tags":["oauth","settings","validation","rest-api"],"backgroundTag":null,"analyzedSha":"f9d3ec372bb580fa8d036f94cf03925a478ef768","analyzedAt":"2026-08-12T19:07:17.372Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}