Skip to content

Commit

Permalink
Create logout.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Haimonti authored Nov 3, 2024
1 parent 116bf16 commit 938014d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions upFAR/backend/logout.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from flask import Blueprint, url_for, redirect
from flask_login import LoginManager, login_required, logout_user

logout = Blueprint('logout', __name__, template_folder='../frontend')
login_manager = LoginManager()
login_manager.init_app(logout)

@logout.route('/logout')
@login_required
def show():
logout_user()
return redirect(url_for('login.show') + '?success=logged-out')

0 comments on commit 938014d

Please sign in to comment.