1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2026-03-31 21:17:23 +02:00

Exclude mru_token in user key hash

This commit is contained in:
Felix Spöttel
2020-09-30 12:34:26 +02:00
parent ada2167d08
commit 1f0e493b8c
2 changed files with 12 additions and 6 deletions

View File

@@ -22,11 +22,17 @@ def get_mfa_state(email, env):
]
def get_public_mfa_state(email, env):
c = open_database(env)
c.execute('SELECT id, type, label FROM mfa WHERE user_id=?', (get_user_id(email, c),))
mfa_state = get_mfa_state(email, env)
return [
{ "id": r[0], "type": r[1], "label": r[2] }
for r in c.fetchall()
{ "id": s["id"], "type": s["type"], "label": s["label"] }
for s in mfa_state
]
def get_hash_mfa_state(email, env):
mfa_state = get_mfa_state(email, env)
return [
{ "id": s["id"], "type": s["type"], "secret": s["secret"] }
for s in mfa_state
]
def enable_mfa(email, type, secret, token, label, env):