Created
November 6, 2021 20:38
-
-
Save StephenFordham/675ce008eed91740a8c10e0759265766 to your computer and use it in GitHub Desktop.
logout_flask_with_flash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@app.route('/logout') | |
@login_required | |
def logout(): | |
logout_user() | |
flash('You have successfully logged out', category='success') | |
session['username'] = None | |
return redirect(url_for('landing_page')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment