mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-10 01:55:41 -04:00
Merge pull request #1136 from alphagov/sign-in-message
Show a more useful message if you get signed out
This commit is contained in:
@@ -16,6 +16,7 @@ from flask_login import (
|
||||
)
|
||||
|
||||
from app import (
|
||||
login_manager,
|
||||
user_api_client,
|
||||
service_api_client,
|
||||
invite_api_client
|
||||
@@ -75,7 +76,14 @@ def sign_in():
|
||||
).format(password_reset=url_for('.forgot_password'))
|
||||
))
|
||||
|
||||
return render_template('views/signin.html', form=form)
|
||||
return render_template('views/signin.html', form=form, again=bool(request.args.get('next')))
|
||||
|
||||
|
||||
@login_manager.unauthorized_handler
|
||||
def sign_in_again():
|
||||
return redirect(
|
||||
url_for('main.sign_in', next=request.path)
|
||||
)
|
||||
|
||||
|
||||
def _get_and_verify_user(user, password):
|
||||
|
||||
@@ -10,9 +10,19 @@
|
||||
|
||||
<div class="grid-row">
|
||||
<div class="column-two-thirds">
|
||||
<h1 class="heading-large">Sign in</h1>
|
||||
|
||||
<p>If you do not have an account, you can <a href="register">create one now</a>.</p>
|
||||
{% if again %}
|
||||
<h1 class="heading-large">You need to sign in again</h1>
|
||||
<p>
|
||||
We sign you out if you haven’t used Notify for a while.
|
||||
</p>
|
||||
{% else %}
|
||||
<h1 class="heading-large">Sign in</h1>
|
||||
<p>
|
||||
If you do not have an account, you can
|
||||
<a href="{{ url_for('.register') }}">create one now</a>.
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
<form method="post" autocomplete="nope">
|
||||
{{ textbox(form.email_address) }}
|
||||
|
||||
Reference in New Issue
Block a user