Add expired explanation page (#145)

This commit is contained in:
Arjen 2021-12-20 22:05:14 +01:00 committed by GitHub
parent 40df900dc7
commit 654d03041b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 2 deletions

View file

@ -184,7 +184,7 @@ def handle_password():
def preview_password(password_key):
password_key = url_unquote_plus(password_key)
if not password_exists(password_key):
abort(404)
return render_template('expired.html'), 404
return render_template('preview.html')
@ -194,7 +194,7 @@ def show_password(password_key):
password_key = url_unquote_plus(password_key)
password = get_password(password_key)
if not password:
abort(404)
return render_template('expired.html'), 404
return render_template('password.html', password=password)

View file

@ -0,0 +1,11 @@
{% extends "base.html" %}
{% block content %}
<div class="container">
<section>
<div class="page-header"><h1>Secret not found, used or expired</h1></div>
<p class="lead">The requested URL was not found on the server. This could be because this URL never contained a secret, or because it expired or revealed earlier.</p>
<p class="lead">If this URL was sent to you by someone, make sure to check your spelling or ask the person who sent it to you to send a new secret.</p>
</section>
</div>
{% endblock %}