INNER CODE UNIT · Python

dashboard

metafy-social/python-scripts · scripts/Authentication System using Flask/main.py:50

def dashboard():
    return render_template('dashboard.html')

@app.route('/logout', methods=["GET", "POST"])
@login_required
def logout():
    logout_user()
    return redirect(url_for('login'))

@app.route('/login', methods=["GET", "POST"])
def login():
    if current_user.is_authenticated:
        return redirect(url_for('dashboard'))

    form = LoginForm()

    if form.validate_on_submit():
        user = User.query.filter_by(username=form.username.data).first()

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…