Skip to content

user logout

Manish Sah edited this page Sep 29, 2020 · 1 revision

user logout

we will create a new route for logout. For logging out user we will be using logout_user method from flask-login package.

lets add these codes in our routes.py

.
from flask_login import logout_user
.

@app.route("/logout")
def logout():
    logout_user()
    return redirect("/")

logout_user does not require any parameter as it already knows which user is logged in.

Implementation can be found over this commit

Clone this wiki locally