Skip to main content

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:

mutation SetupTwoFactor {
setupTwoFactor {
qrCode
backupCodes
}
}

Response:

{
"data": {
"setupTwoFactor": {
"qrCode": "string",
"backupCodes": [
"string"
]
}
}
}
setupTwoFactor: TwoFactorSetupResponse!

Type​

TwoFactorSetupResponse object​

What a user needs to finish setting up two-factor sign in.