Complete a login with a second factor
POST
/api/v1/login/mfa
const url = 'https://osctrl.net/api/v1/login/mfa';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"challenge":"example","code":"example","method":"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://osctrl.net/api/v1/login/mfa \ --header 'Content-Type: application/json' \ --data '{ "challenge": "example", "code": "example", "method": "example" }'Answers an MFA challenge with a TOTP or recovery code and returns a JWT token.
Request Bodyrequired
Section titled “Request Bodyrequired”Request body
Media typeapplication/json
object
challenge
string
code
string
method
Method is “totp” or “recovery”.
string
Examplegenerated
{ "challenge": "example", "code": "example", "method": "example"}Responses
Section titled “Responses”OK
Media typeapplication/json
object
csrf_token
string
token
string
Examplegenerated
{ "csrf_token": "example", "token": "example"}Bad request
Media typeapplication/json
object
code
string
error
string
Examplegenerated
{ "code": "example", "error": "example"}Forbidden
Media typeapplication/json
object
code
string
error
string
Examplegenerated
{ "code": "example", "error": "example"}Too many requests
Media typeapplication/json
object
code
string
error
string
Examplegenerated
{ "code": "example", "error": "example"}Internal server error
Media typeapplication/json
object
code
string
error
string
Examplegenerated
{ "code": "example", "error": "example"}