djangoflow / django-df-auth

Opinionated Django REST auth endpoints for JWT authentication and social accounts
MIT License
12 stars 19 forks source link

Confirming OTPDevice throws 400 error #37

Closed adar2378 closed 11 months ago

adar2378 commented 11 months ago

I have an OTPDevice

{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "id": 2,
      "name": "saiful@apexive.com",
      "type": "email",
      "confirmed": false,
      "key": null
    }
  ]
}

Getting error: status code = 400,

{
  "errors": [
    {
      "message": "Invalid device type. Must be one of email, totp, sms",
      "code": "invalid"
    }
  ]
}
eugapx commented 11 months ago

@adar2378 You need to pass type in URL api/v1/auth/otp-device/2/confirm/?type=email.

eugapx commented 11 months ago

I fixed the API schema, added type param, so should work now