mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-31 20:00:00 -04:00
Show a more useful message if you get signed out
> Users that allow their session to expire, or access a bookmarked link > are told they need to "Sign in to access this page" - we should > explain that it's because they've been away a while, so that they > understand why they're being asked to log in again. – https://www.pivotaltracker.com/story/show/140016919 The message we were showing before (Please log in to access this page is the default message from Flask Login). In order to stop this flash message from appearing, we need to override the default handler for when a user is unauthorised. We’re overriding it with the same behaviour, minus the flash message. If you navigate deliberately to the sign in page it’s unchanged. Content is Sheryll-approved.
This commit is contained in:
@@ -15,7 +15,7 @@ def test_should_redirect_if_not_logged_in(
|
||||
):
|
||||
response = client.get(url_for('main.platform_admin'))
|
||||
assert response.status_code == 302
|
||||
assert url_for('main.index', _external=True) in response.location
|
||||
assert response.location == url_for('main.sign_in', next=url_for('main.platform_admin'), _external=True)
|
||||
|
||||
|
||||
def test_should_403_if_not_platform_admin(
|
||||
|
||||
Reference in New Issue
Block a user