4

I am following the official guide of feathers js authenticate https://docs.feathersjs.com/guides/chat/authentication.html but it seems like even after following the guide step by step I am unable to generate tokens. Here is the body of my request to http://localhost:3030/authentication

{
    "strategy": "local",
    "email": "abc@foo.com",
    "password": "12345678"
}

and here is the response I got

{
    "name": "NotAuthenticated",
    "message": "Invalid login",
    "code": 401,
    "className": "not-authenticated",
    "data": {
        "message": "Invalid login"
    },
    "errors": {}
}

I am using Sequilize with MySQL and I have tested my services using postman and they all are working fine (get/post data from the database)

Assad Ullah
  • 785
  • 6
  • 12
  • Is your "users" service set up correctly? The auth module assumes it can look up users in your "users" service (or whatever you call it in your configuration) to find users, check hashed passwords, etc. – Joe May 17 '19 at 00:11

1 Answers1

2

I figured it out. It was not working because the verify method in authentication-local was verifying the password assuming that the password was hashed using their hashing utility method.

Starting the server with debug mode on have helped to figure out this issue

Assad Ullah
  • 785
  • 6
  • 12
  • 2
    I am having the same issue. Could you please explain how you solved it and maybe show some code. Thank you – vojislav Dec 15 '20 at 14:34