Skip to content

Conversation

@sanki92
Copy link

@sanki92 sanki92 commented Oct 5, 2025

Fix forbidClientAccountCreation Documentation Issue

Problem

Users were confused when setting forbidClientAccountCreation: true in Accounts.config() only on the server side. While this successfully blocks account creation calls, the accounts-ui package still shows the "Create account" link because it only checks the client-side configuration.

Solution

Updated the JSDoc documentation for Accounts.config() to clearly explain:

  1. Added warning to forbidClientAccountCreation parameter explaining it must be set on both client and server
  2. Added practical example showing how to create a shared configuration file that can be imported on both sides
  3. Explains the behavior when only set on server (creation blocked but UI link still visible)

Changes Made

  • Enhanced JSDoc documentation in packages/accounts-base/accounts_common.js
  • Added clear warning with Important notation
  • Included code example showing best practice approach

Example Usage

// lib/accounts-config.js (shared)
import { Accounts } from 'meteor/accounts-base';

Accounts.config({
  forbidClientAccountCreation: true,
  sendVerificationEmail: true,
});

// Import in both client/main.js and server/main.js
import '../lib/accounts-config.js';

Verification

  • No breaking changes to existing functionality
  • Documentation is clear and actionable
  • Follows existing JSDoc patterns in the codebase

Fixes #13922

- Add clear warning that forbidClientAccountCreation must be set on both client and server
- Include practical example showing shared config file approach
- Fixes issue where UI still shows 'Create account' link when only set on server

Fixes meteor#13922
@netlify
Copy link

netlify bot commented Oct 5, 2025

Deploy Preview for v3-migration-docs canceled.

Name Link
🔨 Latest commit 2a1998d
🔍 Latest deploy log https://app.netlify.com/projects/v3-migration-docs/deploys/68e3c3f320929f0008900a46

@netlify
Copy link

netlify bot commented Oct 5, 2025

Deploy Preview for v3-meteor-api-docs canceled.

Name Link
🔨 Latest commit 2a1998d
🔍 Latest deploy log https://app.netlify.com/projects/v3-meteor-api-docs/deploys/68e3c3f3be97cb0008a7827d

@italojs italojs added hacktoberfest hacktoberfest issues for contribuition. hacktoberfest-accepted and removed hacktoberfest hacktoberfest issues for contribuition. labels Oct 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

forbidClientAccountCreation is true, but UI still shows "Create account".

2 participants