From 654d03041bcb8d736f85a4ee1858871dc4105eb5 Mon Sep 17 00:00:00 2001 From: Arjen <4867268+arjentz@users.noreply.github.com> Date: Mon, 20 Dec 2021 22:05:14 +0100 Subject: [PATCH] Add expired explanation page (#145) --- snappass/main.py | 4 ++-- snappass/templates/expired.html | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 snappass/templates/expired.html diff --git a/snappass/main.py b/snappass/main.py index 907d9bf..8877a1e 100644 --- a/snappass/main.py +++ b/snappass/main.py @@ -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) diff --git a/snappass/templates/expired.html b/snappass/templates/expired.html new file mode 100644 index 0000000..5d36855 --- /dev/null +++ b/snappass/templates/expired.html @@ -0,0 +1,11 @@ +{% extends "base.html" %} + +{% block content %} +
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.
+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.
+