Browse Source

remove broken code for logging in with email instead of username

pull/75/head
adam j hartz 1 month ago
parent
commit
12f5ce6e6f
Signed by: hz <hartz@mit.edu> GPG Key ID: 5FDD2840E179AD62
2 changed files with 3 additions and 16 deletions
  1. +3
    -0
      CHANGELOG.md
  2. +0
    -16
      catsoop/__AUTH__/login/login.py

+ 3
- 0
CHANGELOG.md View File

@@ -26,6 +26,9 @@ _Work toward next release. Currently under development._

**REMOVED:**

* Removed slow/broken code for logging in via e-mail instead of username when
using the `login` auth type.

**FIXED:**

* Show an error message when two questions would have the same name (#53)


+ 0
- 16
catsoop/__AUTH__/login/login.py View File

@@ -293,22 +293,6 @@ def get_logged_in_user(context):
entered_password = form.get("cs_hashed_0", "")

valid_uname = True
if _validate_email(context, uname) is None:
# this looks like an e-mail address, not a username.
# find the associated username, if any
# TODO: implement caching of some kind so this isn't so slow/involved
data_root = context.get("cs_data_root", base_context.cs_data_root)
global_log_dir = os.path.join(data_root, "_logs")
for d in os.listdir(global_log_dir):
if not d.endswith(".db"):
continue
u = d[:-3]
e = logging.most_recent("_logininfo", [], u, {})
e = e.get("email", None)
if e == uname:
uname = u
break

vmsg = _validate_username(context, uname)
if vmsg is not None:
valid_uname = False


Loading…
Cancel
Save