mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-20 15:31:15 -05:00
2FA use secret cryptopgraphy
This commit is contained in:
@@ -11,14 +11,12 @@ def _remove_values_for_keys_if_present(dict, keys):
|
|||||||
|
|
||||||
|
|
||||||
def create_secret_code():
|
def create_secret_code():
|
||||||
'''
|
|
||||||
L1 = []
|
L1 = []
|
||||||
for i in range(0, 5):
|
for i in range(0, 5):
|
||||||
L1.append(secrets.randbelow(10)) #return cryptographically strong random number using secrets module
|
L1.append(secrets.randbelow(10)) #return cryptographically strong random number using secrets module
|
||||||
L2 = ''.join(map(str, L1))
|
L2 = ''.join(map(str, L1))
|
||||||
return L2
|
return L2
|
||||||
'''
|
|
||||||
return ''.join(map(str, random.sample(range(9), 5)))
|
|
||||||
|
|
||||||
|
|
||||||
def save_user_attribute(usr, update_dict={}):
|
def save_user_attribute(usr, update_dict={}):
|
||||||
|
|||||||
Reference in New Issue
Block a user