Теперь номера брутить чутка сложнее
This commit is contained in:
parent
f07249e8fb
commit
39463b069b
|
|
@ -142,11 +142,8 @@ class Processors:
|
||||||
await cursor.execute("SELECT * FROM users WHERE phone = %s", (phone,))
|
await cursor.execute("SELECT * FROM users WHERE phone = %s", (phone,))
|
||||||
user = await cursor.fetchone()
|
user = await cursor.fetchone()
|
||||||
|
|
||||||
# Если пользователя нет - отдаем ошибку
|
# Если пользователя найден - сохраняем токен и отправляем код
|
||||||
if user is None:
|
if user:
|
||||||
await self._send_error(seq, self.proto.AUTH_REQUEST, self.error_types.USER_NOT_FOUND, writer)
|
|
||||||
return
|
|
||||||
|
|
||||||
# Сохраняем токен
|
# Сохраняем токен
|
||||||
await cursor.execute("INSERT INTO auth_tokens (phone, token_hash, code_hash, expires) VALUES (%s, %s, %s, %s)", (phone, token_hash, code_hash, expires,))
|
await cursor.execute("INSERT INTO auth_tokens (phone, token_hash, code_hash, expires) VALUES (%s, %s, %s, %s)", (phone, token_hash, code_hash, expires,))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue