Files
notifications-admin/app/main/views/sign_out.py
Rebecca Law 035d4152fd Use session.clear() sign-out.
NOTE: you can not test that the session is cleared out by checking the session cookie does not exist on the index page,
because ItsDangerousSession will create a new session when it hits the index page. The unit test confirms that the session has been cleared.
2016-02-12 15:06:54 +00:00

14 lines
321 B
Python

from flask import (render_template, redirect, url_for)
from flask import session
from flask_login import (login_required, logout_user)
from app.main import main
@main.route('/sign-out', methods=(['GET']))
@login_required
def sign_out():
session.clear()
logout_user()
return redirect(url_for('main.index'))