Search code examples
feathersjsfeathers-authentication

Feathersjs verify user via verifySignupShort pin code


I am working on a proof of concept using feathersJS for signing users up via phone number and verifying via sms and pin https://github.com/morenoh149/feathers-chat-phone-signup-sms

Currently I get the following error

$ sh curls/user-verify.sh 118903
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   208  100   156  100    52  17067   5689 --:--:-- --:--:-- --:--:-- 17333
{
  "name": "BadRequest",
  "message": "Expected string value. (authManagement)",
  "code": 400,
  "className": "bad-request",
  "data": {},
  "errors": {
    "$className": "badParams"
  }
}

the api is using https://github.com/feathers-plus/feathers-authentication-management and I've done my best to adapt it to this use case. My curl looks like

curl --header "Content-Type: application/json" \
  --data '{ "action": "verifySignupShort", "value": 12345 }' \
http://localhost:3030/authmanagement

Solution

  • According to the docs The value should be an Object with a user and token. Token should be a string as well.

    {
        "action": "verifySignupShort",
        "value": {
            "token": "390494",
            "user": {
                "phoneNumber": "5005550006"
            }
        }
    }
    

    Docs: https://github.com/feathers-plus/feathers-authentication-management/blob/master/docs.md