How to check hashed password stored in PSQL DB

How to check hashed password stored in PSQL DB

I want to verify the password by hashing it and then checking the hash on the PSQL DB

I want to verify the password by hashing it and then checking the hash on the PSQL DB

I am trying to compare the hashes - but I am getting an error of Invalid Salt.

Here is my code:

@app.route("/hello", methods=["POST", "GET"])
 def hello():
 email = request.form.get("email")
 password = request.form.get("password")
 password = bcrypt.generate_password_hash(password).decode('utf-8')
 db.execute("INSERT INTO users (email, password) VALUES (:email, 
 :password)",{"email": email, "password": password})
 db.commit()

AND

@app.route("/check", methods=["POST", "GET"])
def check():
    email = request.form.get("login_email")
    check_email_in_db = db.execute("SELECT COUNT(*) FROM users WHERE email = :email", {"email": email}).fetchall()
    if check_email_in_db[0][0] == 1 :
        email = request.form.get("login_email")
        password = request.form.get("login_password")
        retrive_password_from_db = db.execute("SELECT password FROM 
        users WHERE email = :email", {"email": email}).fetchall()
        retrive_password_from_db = retrive_password_from_db[0][0]
        if bcrypt.check_password_hash(password, retrive_password_from_db):
            return("this works")
        else:
            return("something is wrong")


python postgresql flask

What's new in Bootstrap 5 and when Bootstrap 5 release date?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Random Password Generator Online

HTML Color Picker online | HEX Color Picker | RGB Color Picker

Basic Data Types in Python | Python Web Development For Beginners

In the programming world, Data types play an important role. Each Variable is stored in different data types and responsible for various functions. Python had two different objects, and They are mutable and immutable objects.

Python Flask - Introduction to Flask Templates

This is our second tutorial in Python Flask, in this tutorial we are going to have Introduction to Flask Templates, so for this Flask looks for the template

Python Flask-Mail Library to Send Emails in Browser Using Flask Full Project For Beginners

Python Flask-Mail Library to Send Emails in Browser Using Flask Full Project For Beginners #python #flask #flaskmail Welcome Folks My name is Gautam

Python Flask for Beginners: Build a CRUD Web App with Python and Flask

In this Python Flask tutorial, you'll learn to build CRUD web applications using Python and Flask. Python and Flask can make building a CRUD app super easy.

Flask How to Create Routes with Flask-Classy - Code Loop

In this Flask article we are going to learn How to Create Routes with Flask-Classy, Flask-Classy is an extension that adds class-based views to Flask. so