We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b28e390 commit 925c986Copy full SHA for 925c986
monkey/monkey_island/cc/services/authentication_service/authentication_facade.py
@@ -16,6 +16,7 @@
16
from .user import User
17
18
OTP_EXPIRATION_TIME = 2 * 60 # 2 minutes
19
+OTP_LENGTH = 16
20
21
22
class AuthenticationFacade:
@@ -87,7 +88,9 @@ def generate_otp(self) -> OTP:
87
88
89
The generated OTP is saved to the `IOTPRepository`
90
"""
- otp = OTP(secure_generate_random_string(32, string.ascii_letters + string.digits + "._-"))
91
+ otp = OTP(
92
+ secure_generate_random_string(OTP_LENGTH, string.ascii_letters + string.digits + "._-")
93
+ )
94
expiration_time = time.monotonic() + OTP_EXPIRATION_TIME
95
self._otp_repository.insert_otp(otp, expiration_time)
96
0 commit comments