I would like to render a specific Angular component after a serverside Python Flask process.
I would like to connect my user only if Password and Confirm_Password are the same. This check is done on the server for more security.
Here is my Flask code :
@app.route('/sign/', methods=['POST', 'GET'])
def register():
if request.method == 'POST':
users = mongo.db.users
existing_user = users.find_one({'identifiant' : request.form['username']})
if existing_user is None:
if request.form['password']==request.form['password2']:
hashpass = bcrypt.hashpw(request.form['password'].encode('utf-8'), bcrypt.gensalt())
users.insert({'identifiant' : request.form['username'], 'email':request.form['email'], 'password' : hashpass})
else:
#return("Les mots de passes sont differents")
return render_template("sign", message="Hello Flask!")
else :
return 'That username already exists!'
return redirect(url_for('hello'))
If Password != Confirm_Password, I would like to render a specific component that says "Passwords are not the same". The issue is that I can't render a specific Angular component with Flask...