diff --git a/app/config/globalvar.py b/app/config/globalvar.py index 2c3a6a1..581ee5a 100644 --- a/app/config/globalvar.py +++ b/app/config/globalvar.py @@ -1,11 +1,11 @@ -title = "Authsquare" -header = f"Welcome to {title}" -copyright = "Copyright (C) 2024 Dita Aji Pratama" +title = "Authsquare" +header = f"Welcome to {title}" +copyright = "Copyright (C) 2024 Dita Aji Pratama" -production = False -su_mode = True +production = False +forbidden_registration = ['su', 'admin'] -auth_key = 'your_key' +auth_key = 'your_key' ssh = { "key":{ diff --git a/app/modules/api/auth.py b/app/modules/api/auth.py index 91b5e8e..9d76aa0 100644 --- a/app/modules/api/auth.py +++ b/app/modules/api/auth.py @@ -53,9 +53,9 @@ class auth: response["data" ] = { "recaptcha":captcha_r } - elif globalvar.su_mode == False and roles == 'su': + elif roles in globalvar.forbidden_registration: response["status" ] = "failed" - response["desc" ] = "Forbidden to become super user" + response["desc" ] = f"Forbidden to become {roles}" response["data" ] = { "recaptcha":captcha_r }