thomasht86 commited on
Commit
2592ace
·
verified ·
1 Parent(s): 4db4282

deploy at 2024-08-24 16:57:12.985098

Browse files
Files changed (1) hide show
  1. main.py +4 -3
main.py CHANGED
@@ -442,9 +442,10 @@ def post(login: Login, sess):
442
  if not compare_digest(ADMIN_PWD.encode("utf-8"), login.pwd.encode("utf-8")):
443
  # Incorrect password - add error message
444
  return RedirectResponse("/login?error=True", status_code=303)
445
- sess["auth"] = True
446
- print(f"Sess after login: {sess}")
447
- return RedirectResponse("/admin", status_code=303)
 
448
 
449
 
450
  @app.get("/logout")
 
442
  if not compare_digest(ADMIN_PWD.encode("utf-8"), login.pwd.encode("utf-8")):
443
  # Incorrect password - add error message
444
  return RedirectResponse("/login?error=True", status_code=303)
445
+ print(f"Session after setting auth: {sess}")
446
+ response = RedirectResponse("/admin", status_code=303)
447
+ print(f"Cookies being set: {response.headers.get('Set-Cookie')}")
448
+ return response
449
 
450
 
451
  @app.get("/logout")