enableTwoFactor
Requires an authenticated session.
Turns on two-factor sign-in by checking a code from the authenticator app against the setup started by setupTwoFactor. Fails if the setup has expired or the code is wrong.
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 EnableTwoFactor($input: EnableTwoFactorInput!) {
enableTwoFactor(input: $input)
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation EnableTwoFactor($input: EnableTwoFactorInput!) {\n enableTwoFactor(input: $input)\n}",
"variables": {
"input": {
"token": "string"
}
}
}
EOF
Variables:
{
"input": {
"token": "string"
}
}
Response:
{
"data": {
"enableTwoFactor": true
}
}
enableTwoFactor(
input: EnableTwoFactorInput!
): Boolean!
Arguments
enableTwoFactor.input ● EnableTwoFactorInput! non-null input
The code from the authenticator app and an optional device name.
Type
Boolean scalar
The Boolean scalar type represents true or false.