1

In data, coming from data = cursor.fetchone(), I have (id, 'user', 'email', 'pbkdf2:sha256:50000$') [A user from the db].

How can I do to get the crypted password? I want to compare it with the entered password and do the login.

I tryed password = data['user_password'], but when I ckeck with app.logger.info(password) it shows me nothing.

'user_password' is the column from my database. This is why I did data['user_password']. Is this wrong?

Help me please! Thank you!

4
  • You say that something is wrong, but as far as I can see you don't say what it is. What is happening that you don't expect? Commented Feb 15, 2018 at 11:43
  • app.logger.info(password) shows me nothing. So I suppose that password = data['user_password'] doens't work for me. How could I change that, so I can compare the two passwords? Commented Feb 15, 2018 at 12:15
  • I'm not sure but per <input type="password" name="inputPassword" id="inputPassword" class="form-control" placeholder="Password" required> should not you be using data['inputPassword']? Commented Feb 15, 2018 at 12:47
  • user_password it's the column from the database, since in data I have the user from the database Commented Feb 15, 2018 at 12:50

1 Answer 1

1

Another way to achieve your purpose is to get the column value by using its index.

password = data[3]
app.logger.info(password)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.