[Question] Is it possible to allow only certain user logins?
Closed this issue · 2 comments
Forgive me if this is documented somewhere, but I'm using the standalone WebUI on a current CentOS server I'm running. I was wondering how easy it would be to be able to only allow a single user to login?
Looking through the code, I'm thinking if I manually change the file auth.py around line 105 and override the username variable, this may accomplish what I'm after. Then I can change the input to hidden on the login form.
Do you have any recommendations/advice against this? On a side, thank you for the work you've put into this, it's saved me a lot of bother!
You are correct; the best way to address this would likely be in auth.py in the login function @ line 101. Right there at 102 you can see:
if not username or not password:
return self.get_loginform()
You could effectively change this part to...
if not username or not password:
return self.get_loginform()
elif username not in ["validated_user", "okay_for_go_user"]:
return self.get_loginform()
Sounds perfect, thank you!