Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setToken Function #77

Open
tonylomax opened this issue Aug 16, 2019 · 0 comments
Open

setToken Function #77

tonylomax opened this issue Aug 16, 2019 · 0 comments
Labels
bug Something isn't working

Comments

@tonylomax
Copy link

One way of fixing this:

This bit

getUD
      .getUD(username, password)
      .then(dbPassword => {
        console.log(dbPassword);
      })

Like you say returns an object. To get the password and run the compare function in bcrypt you can try and return dbPassword.rows from the getUD.js. You can then iterate through the response like this:

response.rows[0][password] 

which will get this part of the object:

rows:
   [ { password:
        '$2b$10$a9/KgpWGLJ6DhuT5fKExqegKc8tRdCMhWTO34gRIrAeycKHoolPLO' } ],
@tonylomax tonylomax added the bug Something isn't working label Aug 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant