mirror of
https://gitlab.com/akasroua/covot
synced 2025-12-24 16:11:55 +01:00
Implement 2FA code verification
This commit is contained in:
@@ -25,3 +25,18 @@ def create_database(data):
|
||||
if existing_row:
|
||||
return
|
||||
insert_data(data)
|
||||
|
||||
|
||||
def save_attribute(attribute, data):
|
||||
key = eval("Users." + attribute)
|
||||
db.query(Users).filter(
|
||||
or_(Users.correo_institucional == id, Users.numero_de_documento == id)
|
||||
).update({key: data})
|
||||
|
||||
|
||||
def verify_code(id, code):
|
||||
db_record = search_database(id=id)
|
||||
valid_code = code == db_record
|
||||
if valid_code:
|
||||
return True
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user