|
|
@ -29,7 +29,8 @@ class Authentication: |
|
|
|
return True |
|
|
|
|
|
|
|
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=?", |
|
|
|
(profileId,)).fetchone() |
|
|
|
if res is not None: |
|
|
@ -40,9 +41,9 @@ class Authentication: |
|
|
|
(user,)).fetchone() |
|
|
|
if res is None or res[0] != 1: |
|
|
|
return False |
|
|
|
c.execute("DELETE FROM new WHERE user=?", (user,)) |
|
|
|
|
|
|
|
# Create new user |
|
|
|
c.execute("DELETE FROM new WHERE user=?", (user,)) |
|
|
|
c.execute("INSERT INTO users VALUES (?, ?, ?)", |
|
|
|
(profileId, token, user)) |
|
|
|
return True |
|
|
|