mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-05 16:38:59 -04:00
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.
14 lines
321 B
Python
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'))
|