INNER CODE UNIT · Python

home

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

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

@app.route('/dashboard', methods=["GET", "POST"])
@login_required
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'))

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…