diff --git a/bin/lib/ail_users.py b/bin/lib/ail_users.py index 44c8ce2e..d5406580 100755 --- a/bin/lib/ail_users.py +++ b/bin/lib/ail_users.py @@ -37,6 +37,9 @@ if config_loader.get_config_boolean('Users', 'force_2fa'): r_serv_db.hset('ail:2fa', '2fa', 1) else: r_serv_db.hset('ail:2fa', '2fa', 0) + +ail_2fa_name = config_loader.get_config_str('Users', '2fa_name') + config_loader = None regex_password = r'^(?=(.*\d){2})(?=.*[a-z])(?=.*[A-Z]).{10,100}$' @@ -541,7 +544,7 @@ class AILUser(UserMixin): def init_setup_2fa(self, create=True): if create: create_user_otp(self.user_id) - instance_name = 'AIL TEST' + instance_name = f'{ail_2fa_name}: {self.user_id}' return get_user_otp_qr_code(self.user_id, instance_name), get_user_otp_uri(self.user_id, instance_name), get_user_hotp_code(self.user_id) def setup_2fa(self): diff --git a/configs/core.cfg.sample b/configs/core.cfg.sample index 1bb77e4a..7e091001 100644 --- a/configs/core.cfg.sample +++ b/configs/core.cfg.sample @@ -82,6 +82,7 @@ DiffMaxLineLength = 10000 ##### Users ##### [Users] force_2fa = False +2fa_name = AIL [AIL_2_AIL] server_host = 0.0.0.0