jasminefiner
9/21/2018 - 2:01 PM

15: Update Views

User Management System: User Authentication 15

# app/auth_blueprint/views.py
from flask_login import login_user, current_user

@auth.route('/login', methods=['GET', 'POST'])
def login():
    form = LogInForm()
    if current_user.is_authenticated:
        flash('You are already logged in!', 'warning')
        return redirect(url_for('main.index'))
    # ...