Files
GridFlow/docs/password_reset.md

1.4 KiB

Password reset

Request for OTP

You will need to provide existing account phone number in this request

curl --request POST \
  --url https://api.fenaka.mv/auth/password-reset/request \
  --header 'authorization: Bearer TOKEN' \
  --header 'content-type: application/json' \
  --data '{"mobile":"PHONE_NUMBER"}'
  • This should send a 1 digit OTP to phone number you requested, but at the time of writing this document fenaka SMS seems to be broken

You will also get a "Set-Cookie" in reponse header, which will be needed for submitting OTP, store this header somewhere for later user

Set-Cookie: connect.sid=; HttpOnly; Path=/

(you only need the part before the first ";")

HTTP 200

  • You will just the requested phone number in json
{
  "mobile": ""
}

HTTP 404

  • You will get this reponse if there is no registered account
{
  "error": "not-found"
}

Submit OTP

I CANNOT TEST THIS AT THE TIME OF WRITING THIS DOCUMENT BECAUSE SMS IS NOT WORKING
but here is how to:

curl --request POST \
  --url https://api.fenaka.mv/auth/verify-otp/password-reset \
  --header 'authorization: Bearer TOKEN' \
  --header 'content-type: application/json' \
  --data '{"otp":"1111"}'

HTTP 422

{
  "errors": [
    {
      "value": "1111",
      "msg": "invalid otp",
      "param": "otp",
      "location": "body"
    }
  ]
}