nevotheless
nevotheless

Reputation: 904

Feathersjs local auth password verification doesn't work

I've set the fields:

local: { usernameField: 'username', passwordField: 'sha_pass_hash' }

and the model like it is supposed to be. Whenever i try to send my payload to the server i only receive error: (401) Route: /auth/local - Invalid login.

Now my question is how the password verification works, since i, by no chance, can get this working.

The Password is stored as a sha1 inside the database and i sent the sha1 password as part of the payload.

Why is it not comparing them directly, what exactly does it? I'm just confused.

Upvotes: 1

Views: 724

Answers (1)

Daff
Daff

Reputation: 44215

The default hash comparison is expecting a bcrypt hashed (+ salted) string (created by the hashPassword hook).

If you want to use plain SHA1 hashed passwords you can use auth 1.0 and implement a custom verifier.

Upvotes: 2

Related Questions