Safeguard against empty mru_token column
* hmac.compare_digest() expects arguments of type string, make sure we don't pass None * Currently, this cannot happen but we might not want to store `mru_token` during setup
This commit is contained in:
parent
49c333221a
commit
4791c2fc62
|
@ -557,10 +557,12 @@ def get_mfa_state(email, env):
|
||||||
if credential_row is None:
|
if credential_row is None:
|
||||||
return { 'type': None }
|
return { 'type': None }
|
||||||
|
|
||||||
|
secret, mru_token = credential_row
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'type': 'totp',
|
'type': 'totp',
|
||||||
'secret': credential_row[0],
|
'secret': secret,
|
||||||
'mru_token': credential_row[1]
|
'mru_token': '' if mru_token is None else mru_token
|
||||||
}
|
}
|
||||||
|
|
||||||
def create_totp_credential(email, secret, token, env):
|
def create_totp_credential(email, secret, token, env):
|
||||||
|
|
Loading…
Reference in New Issue