added login cookie, added change pwd screen

This commit is contained in:
2026-01-18 08:22:41 +01:00
parent 2d7297e3b7
commit 23631c6d24
10 changed files with 480 additions and 22 deletions
+11 -4
View File
@@ -1,8 +1,9 @@
from flask import Blueprint, render_template, redirect, url_for, request
from flask import Blueprint, render_template, redirect, url_for, request, make_response
from flask_login import login_required, current_user
from models import db
from models import User, ListOfItems, Item, Shared
from log import Log
from auth import create_cookie
lists_bp = Blueprint("lists", __name__)
@@ -17,7 +18,11 @@ def not_current_user(current_user_id):
@lists_bp.route("/")
@login_required
def home():
return render_template("lists_show.html", user=current_user, ilists=current_user.all_my_lists())
resp = make_response(render_template("lists_show.html", user=current_user, ilists=current_user.all_my_lists(),
button_top_url1 = url_for("auth.change_pwd"),
button_top_txt1 = "add",))
resp.set_cookie('username', create_cookie(current_user.id))
return resp
@lists_bp.route("/lists_edit", methods=["GET", "POST"])
@login_required
@@ -77,7 +82,9 @@ def edit():
return home()
return render_template("lists_edit.html", user=current_user,
resp = make_response(render_template("lists_edit.html", user=current_user,
ilists=current_user.my_owned_lists(with_inactive=True),
users=not_current_user(current_user.id),
newlist=newlist)
newlist=newlist))
resp.set_cookie('username', create_cookie(current_user.id))
return resp