Flask-Web-App-Tutorial icon indicating copy to clipboard operation
Flask-Web-App-Tutorial copied to clipboard

AttributeError: 'NoneType' object has no attribute 'encode' in if check_password_hash(user.password, password):

Open Jhomarie11 opened this issue 3 years ago • 0 comments

email = request.form.get('email') password = request.form.get('password1')

    user = User.query.filter_by(email=email).first()
    if user:
        if check_password_hash(user.password, password):
            flash('Logged in successfully!', category='success')Open an interactive python shell in this frame
            login_user(user, remember=True)
            return redirect(url_for('views.home'))
        else:
            flash('Incorrect password, try again.', category='error')

Jhomarie11 avatar Jul 30 '22 21:07 Jhomarie11