verifyMultiFactor
POST
/api/v1/auth/mfa/verify
const url = 'https://example.com/api/v1/auth/mfa/verify';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"challengeToken":"example","code":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/auth/mfa/verify \ --header 'Content-Type: application/json' \ --data '{ "challengeToken": "example", "code": "example" }'Completes a pending sign-in with an authenticator or recovery code.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
challengeToken
required
string
code
required
An authenticator code or a recovery code. The server decides which by shape; six digits are never matched against recovery codes.
string
Examplegenerated
{ "challengeToken": "example", "code": "example"}Responses
Section titled “ Responses ”Signed in
Media typeapplication/json
object
data
required
object
user
required
object
id
required
string format: uuid
name
required
string
username
required
string
role
required
Role key. The built-in roles are owner, administrator, editor, contributor, and viewer. Custom role keys start with “custom.”. Decide authorization from the capabilities the server reports, not from the role key.
string
active
required
boolean
createdAt
required
string format: date-time
lastLoginAt
string format: date-time
capabilities
Effective capabilities of the signed-in user’s role.
Array<string>
csrfToken
required
string
authMethod
required
string
mfaEnrollmentRequired
required
boolean
Example
{ "data": { "user": { "role": "owner" }, "authMethod": "password" }}Incorrect code or expired challenge
Too many incorrect codes