setupTwoFactor
Requires an authenticated session.
Starts two-factor setup for the signed-in user and returns a QR code and backup codes. The setup is kept for 10 minutes and nothing is turned on until enableTwoFactor succeeds.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
mutation SetupTwoFactor {
setupTwoFactor {
qrCode
backupCodes
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation SetupTwoFactor {\n setupTwoFactor {\n qrCode\n backupCodes\n }\n}"
}
EOF
Response:
{
"data": {
"setupTwoFactor": {
"qrCode": "string",
"backupCodes": [
"string"
]
}
}
}
setupTwoFactor: TwoFactorSetupResponse!
Type
TwoFactorSetupResponse object
What a user needs to finish setting up two-factor sign in.