diff --git a/auth/auth.py b/auth/auth.py index e79173f..0ca1aa9 100644 --- a/auth/auth.py +++ b/auth/auth.py @@ -19,8 +19,6 @@ class Authentication: "CREATE TABLE IF NOT EXISTS new(user)") def check_token(self, profileId, token): - if len(token) != 43: - return False with self.connect() as c: res = c.execute("SELECT token FROM users WHERE profileId=?", (profileId,)).fetchone() @@ -37,6 +35,8 @@ class Authentication: return res[0] == user # Check if new user can be created + if len(token) != 43: + return False res = c.execute("SELECT 1 FROM new WHERE user=?", (user,)).fetchone() if res is None or res[0] != 1: