fix a bug where accumulating stale login tokens can lock out an account

이 커밋은 다음에 포함됨:
2021-01-31 18:02:46 -06:00
부모 cbe658b7ae
커밋 645ddede02
+1 -1
파일 보기
@@ -21,7 +21,7 @@ class DBModel:
if hasExactMatch == 0:
self.cursor.execute("INSERT INTO accounts (email, lower_case_email) VALUES (%s, %s)", (email, email.lower()))
self.cursor.execute("SELECT token FROM login_tokens WHERE email = %s", (email, ))
self.cursor.execute("SELECT token FROM login_tokens WHERE email = %s and created > (NOW() - INTERVAL '20 min')", (email, ))
if len(self.cursor.fetchall()) > 2:
return (None, ignoreCaseMatches)