RocketChat/Rocket.Chat · error · Meteor.Error
error-name-param-not-provided
error-name-param-not-provided
Error message
The parameter "name" is required
What it means
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.
Source
Thrown at apps/meteor/server/api/v1/settings.ts:250
POST: { permissions: ['add-oauth-service'], operation: 'hasAll' },
},
body: addCustomOAuthBodySchema,
response: {
200: ajv.compile<void>({
type: 'object',
properties: { success: { type: 'boolean', enum: [true] } },
required: ['success'],
additionalProperties: false,
}),
400: validateBadRequestErrorResponse,
401: validateUnauthorizedErrorResponse,
403: validateForbiddenErrorResponse,
},
},
async function action() {
const { name } = this.bodyParams;
if (!name?.trim()) {
throw new Meteor.Error('error-name-param-not-provided', 'The parameter "name" is required');
}
await addOAuthServiceMethod(this.userId, name);
return API.v1.success();
},
);
API.v1.post(
'settings.removeCustomOAuth',
{
authRequired: true,
twoFactorRequired: true,
permissionsRequired: {
POST: { permissions: ['add-oauth-service'], operation: 'hasAll' },
},
body: addCustomOAuthBodySchema,
response: {View on GitHub (pinned to f9d3ec372b)
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.
Example fix
// before
await rest.post('/api/v1/settings.addCustomOAuth', { name: '' });
// after
const name = 'google';
if (!name.trim()) throw new Error('OAuth provider name required');
await rest.post('/api/v1/settings.addCustomOAuth', { name }); Defensive patterns
Strategy: validation
Validate before calling
const name = (body.name ?? '').toString().trim();
if (!name) throw new Error('OAuth provider name required');
await rest.post('/api/v1/settings.addCustomOAuth', { name }); Type guard
function isNonEmptyName(s: unknown): s is string {
return typeof s === 'string' && s.trim().length > 0;
} Try / catch
try {
await rest.post('/api/v1/settings.addCustomOAuth', { name });
} catch (e) {
if (isMeteorError(e, 'error-name-param-not-provided')) {
notify('Provider name is required.');
} else throw e;
} Prevention
- Trim and validate name client-side.
- Use a recognized provider key.
- Disable submit while the name field is empty.
When it happens
Trigger: POST /api/v1/settings.addCustomOAuth with an empty/missing/whitespace 'name' in the body.
Common situations: Automation that forgot to template the name; trailing-space-only value; form submitted with empty provider name.
Related errors
- error-id-param-not-provided
- The setting "${id}" is not readable.
- The setting "${setting.id}" is not readable.
- error-abac-not-enabled
- The "${name}" parameter must be a valid date.
AI-assisted analysis of RocketChat/Rocket.Chat@f9d3ec372b (2026-08-12).
Data as JSON: /api/errors/bc0135fd7856504b.
Report an issue: GitHub.