Skip to main content
POST
/
v1
/
auth
/
2fa
/
verify
Verify 2FA
curl --request POST \
  --url https://olp-api.nipuntheekshana.com/v1/auth/2fa/verify \
  --header 'Content-Type: application/json' \
  --data '
{
  "code": "<string>"
}
'
This endpoint requires a valid Bearer token in the Authorization header.
Completes the two-factor authentication setup by verifying a TOTP code generated from the secret provided during Setup 2FA. Once verified, all future login attempts will require a TOTP code.

Request Body

code
string
required
Six-digit TOTP code from the authenticator app.

Example Request

{
  "code": "482910"
}

Example Response (200)

{
  "message": "Two-factor authentication enabled successfully",
  "recoveryCodes": [
    "abc12-def34",
    "ghi56-jkl78",
    "mno90-pqr12",
    "stu34-vwx56",
    "yza78-bcd90"
  ]
}
Store the recovery codes securely. They can be used to regain access if the authenticator device is lost.

Error Responses

400 Invalid Code
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid TOTP code"
  }
}