setupTOTPDevice
Overview
Starts setting up a two-factor device for the signed-in user. For email and sms, the server sends a code to the destination; for totp, it returns the secret and a QR code. Before rejecting with an UnauthorizedError, refetches the current user, so authPendingFlow names the flow that the server now requires.
Signature
setupTOTPDevice(payload)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| payload | object | yes | The request body. |
payload Properties
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| destination | string | The email address or phone number; required for email and sms. | ||
| method | string | The device method: totp, email, or sms. |
Returns
Promise
For totp, an object whose meta holds totp_secret and totp_svg_data_uri.
Source
client/lib/stores/storeUser.js:510