Add documentation for accounts-passwordless

This commit is contained in:
Jan Dvorak
2021-10-25 09:35:38 +02:00
parent 2ce694b4c4
commit 1d6118d653
5 changed files with 26 additions and 5 deletions

View File

@@ -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.

View File

@@ -55,6 +55,7 @@ sidebar_categories:
- api/environment
Packages:
- packages/accounts-ui
- packages/accounts-passwordless
- packages/appcache
- packages/audit-argument-checks
- packages/autoupdate

View File

@@ -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 */ }
}
```

View File

@@ -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 = (

View File

@@ -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.
*/