Browse Source

Fix 4

master
mid-kid 3 weeks ago
parent
commit
d816cd1912
  1. 5
      auth/auth.py

5
auth/auth.py

@ -29,7 +29,8 @@ class Authentication:
return True return True
def check_user(self, profileId, token, user): def check_user(self, profileId, token, user):
with self.connect() as c: with self.connect() as con:
with con.cursor() as c:
res = c.execute("SELECT user FROM users WHERE profileId=?", res = c.execute("SELECT user FROM users WHERE profileId=?",
(profileId,)).fetchone() (profileId,)).fetchone()
if res is not None: if res is not None:
@ -40,9 +41,9 @@ class Authentication:
(user,)).fetchone() (user,)).fetchone()
if res is None or res[0] != 1: if res is None or res[0] != 1:
return False return False
c.execute("DELETE FROM new WHERE user=?", (user,))
# Create new user # Create new user
c.execute("DELETE FROM new WHERE user=?", (user,))
c.execute("INSERT INTO users VALUES (?, ?, ?)", c.execute("INSERT INTO users VALUES (?, ?, ?)",
(profileId, token, user)) (profileId, token, user))
return True return True

Loading…
Cancel
Save