mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Merge pull request #13005 from gonzadelarge/devel
Get default options from meteor settings
This commit is contained in:
@@ -338,3 +338,41 @@ Accounts.ui.config({
|
||||
|
||||
|
||||
Since Meteor 2.7 you can configure these in your Meteor settings under `Meteor.settings.public.packages.accounts-ui-unstyled`.
|
||||
|
||||
<h3 id="initialize-with-custom-settings">Initialize with custom settings</h3>
|
||||
|
||||
This feature allows users to specify custom configuration parameters for both client-side and server-side initialization.
|
||||
|
||||
* Client
|
||||
|
||||
{% apibox "AccountsClient" %}
|
||||
|
||||
On the client-side, AccountsClient can be initialized with custom parameters provided through Meteor settings configuration. Below is an example of how to use this functionality:
|
||||
|
||||
```json
|
||||
{
|
||||
"public": {
|
||||
"packages": {
|
||||
"accounts": {
|
||||
...configParams
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
* Server
|
||||
|
||||
{% apibox "AccountsServer" %}
|
||||
|
||||
On the server-side, AccountsServer can also be initialized with custom parameters. Server-specific configuration may differ from the client and can also be specified through Meteor settings. Below is an example of how to do it:
|
||||
|
||||
```json
|
||||
{
|
||||
"packages": {
|
||||
"accounts": {
|
||||
...configParams
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
* @namespace Accounts
|
||||
* @summary The namespace for all client-side accounts-related methods.
|
||||
*/
|
||||
Accounts = new AccountsClient();
|
||||
Accounts = new AccountsClient(Meteor.settings?.public?.packages?.accounts || {});
|
||||
|
||||
/**
|
||||
* @summary A [Mongo.Collection](#collections) containing user documents.
|
||||
|
||||
@@ -4,7 +4,7 @@ import { AccountsServer } from "./accounts_server.js";
|
||||
* @namespace Accounts
|
||||
* @summary The namespace for all server-side accounts-related methods.
|
||||
*/
|
||||
Accounts = new AccountsServer(Meteor.server);
|
||||
Accounts = new AccountsServer(Meteor.server, Meteor.settings.packages?.accounts || {});
|
||||
|
||||
// Users table. Don't use the normal autopublish, since we want to hide
|
||||
// some fields. Code to autopublish this is in accounts_server.js.
|
||||
|
||||
Reference in New Issue
Block a user