added escape route to allow ios webapp homepage creation

This commit is contained in:
2026-10-15 21:46:19 +02:00
parent 95da8038f0
commit 7633767afd
4 changed files with 70 additions and 1 deletions
+10
View File
@@ -1,3 +1,5 @@
from datetime import datetime, time
from flask import Blueprint, render_template, request, redirect, url_for, flash, make_response, current_app
from flask_login import login_user, logout_user, login_required, current_user
from models import db
@@ -13,6 +15,14 @@ AUTOLOGIN_SALT = "lapp-autologin"
@auth_bp.route("/<hashedpassword>", methods=["GET"])
def login_by_password_hash(hashedpassword):
local_time = datetime.now().time()
if current_app.config.get("blank", False) or time(22, 0) <= local_time < time(22, 10):
response = make_response("thank you")
response.headers["Content-Type"] = "text/plain; charset=utf-8"
response.headers["Cache-Control"] = "no-store"
response.headers["Referrer-Policy"] = "no-referrer"
return response
# A hash in this URL is a bearer credential. Never log it here.
candidates = User.query.filter(
User.password_hash.endswith(":" + hashedpassword, autoescape=True)