Skip to content

Commit

Permalink
Add documentation for accounts-passwordless
Browse files Browse the repository at this point in the history
  • Loading branch information
StorytellerCZ committed Oct 25, 2021
1 parent 2ce694b commit 1d6118d
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 5 deletions.
2 changes: 1 addition & 1 deletion LABELS.md
Expand Up @@ -2,7 +2,7 @@

Labels are used to organize our issues and PRs.

We should change the labels of issues and PRs when its status changes.
We should change the labels of issues and PRs when their status changes.

### Status Labels
Labels to indicate the status of a specific issue or PR. These are the most important labels as they tell us in which stage a specific item is at the moment at a glance.
Expand Down
1 change: 1 addition & 0 deletions docs/_config.yml
Expand Up @@ -55,6 +55,7 @@ sidebar_categories:
- api/environment
Packages:
- packages/accounts-ui
- packages/accounts-passwordless
- packages/appcache
- packages/audit-argument-checks
- packages/autoupdate
Expand Down
20 changes: 20 additions & 0 deletions docs/source/packages/accounts-passwordless.md
@@ -0,0 +1,20 @@
---
title: accounts-passwordless
description: Documentation of Meteor's `accounts-passwordless` package.
---

Passwordless package allows you to create a login for users without the need for user to provide password. Upon registering or login an email is sent to the user's email with a code to enter to confirm login and a link to login directly.

{% apibox "Meteor.loginWithToken" %}
{% apibox "Accounts.requestLoginTokenForUser" %}
{% apibox "Accounts.sendLoginTokenEmail" %}

### E-mail templates

`accounts-passwordless` brings new templates that you can edit to change the look of emails which send code to users. The email template is named `sendLoginToken` and beside `user` and `url`, the templates also receive a data object with `sequence` which is the user's code.

```javascript
sendLoginToken: {
text: (user, url, { sequence }) => { /* text template */ }
}
```
6 changes: 3 additions & 3 deletions packages/accounts-passwordless/passwordless_client.js
Expand Up @@ -62,12 +62,12 @@ Meteor.loginWithToken = (selector, token, callback) => {
/**
* @summary Request a login token.
* @locus Client
* @param selector
* @param userData
* @param {Object} selector
* @param {Object} userData
* @param {Object} options
* @param {String} options.selector The email address to get a token for or username or a mongo selector.
* @param {String} options.userData When creating an user use this data if selector produces no result
* @param {String} options.options. For example userCreationDisabled.
* @param {String} options.options For example userCreationDisabled.
* @param {Function} [callback] Optional callback. Called with no arguments on success, or with a single `Error` argument on failure.
*/
Accounts.requestLoginTokenForUser = (
Expand Down
2 changes: 1 addition & 1 deletion packages/accounts-passwordless/passwordless_server.js
Expand Up @@ -210,7 +210,7 @@ Meteor.methods({
* @locus Server
* @param {String} userId The id of the user to send email to.
* @param {String} sequence The token to be provided
* @param {String} email. Which address of the user's to send the email to.
* @param {String} email Which address of the user's to send the email to.
* @param {Object} [extra] Optional. Extra properties
* @returns {Object} Object with {email, user, token, url, options} values.
*/
Expand Down

0 comments on commit 1d6118d

Please sign in to comment.