Accounts/Methods

Accounts/Methods

Source:

Extends Meteor's Accounts-Base with methods for Reaction-specific behavior and user interaction. Run these methods using: Meteor.call()

Example

Meteor.call("accounts/verifyAccount", email, token)

Methods

(static) accounts/addUserPermissions(userId, permissions, groupopt) → {Boolean}

Source:
Parameters:
Name Type Attributes Description
userId String

userId

permissions Array | String

Name of role/permission. If array, users returned will have at least one of the roles specified but need not have all roles.

group String <optional>

Optional name of group to restrict roles to. User's Roles.GLOBAL_GROUP will also be checked.

Returns:

success/failure

Type
Boolean

(static) accounts/createFallbackLoginToken() → {String|null}

Returns a new loginToken for current user, that can be used for special login scenarios e.g. store the newly created token as cookie on the browser, if the client does not offer local storage.

Source:
Returns:

loginToken for current user

Type
String | null

(static) accounts/removeUserPermissions(userId, permissions, groupopt) → {Boolean}

Source:
Parameters:
Name Type Attributes Description
userId String

userId

permissions Array | String

Name of role/permission. If array, users returned will have at least one of the roles specified but need not have all roles.

group String <optional>

Optional name of group to restrict roles to.

Returns:

success/failure

Type
Boolean

(static) accounts/sendResetPasswordEmail(options) → {undefined}

Send reset password email

Source:
Example
Meteor.call("accounts/sendResetPasswordEmail", options)
Parameters:
Name Type Description
options Object

Options object

Properties
Name Type Description
email String

email of user

Returns:
Type
undefined

(static) accounts/setActiveShopId(shopId) → {Object}

Sets users profile currency

Source:
Parameters:
Name Type Description
shopId String

Shop ID to make active for the current user

Returns:

Account document

Type
Object

(static) accounts/setUserPermissions(userId, permissions, group) → {Boolean}

Source:
Parameters:
Name Type Description
userId String

userId

permissions String | Array

string/array of permissions

group String

group

Returns:

returns Roles.setUserRoles result

Type
Boolean

(static) accounts/updateEmailAddress(email) → {Boolean}

Update a user's email address

Source:
Parameters:
Name Type Description
email String

user email

Returns:
  • return True on success
Type
Boolean

(static) accounts/updateServiceConfiguration(service, fields) → {Boolean}

Update service configuration

Source:
Example
Meteor.call("accounts/updateServiceConfiguration", service, fields, (callBackFunction))
Parameters:
Name Type Description
service String

Service name

fields Array

Fields array

Returns:

Upsert result or false

Type
Boolean

(static) accounts/verifyAccount() → {Boolean}

Verifies the email address in account document (if user verification in users collection was successful already)

Source:
Example
Meteor.call("accounts/verifyAccount")
Returns:
  • returns true on success
Type
Boolean