Repository navigation
Disabling registration not actually working? #1340
|
I'm using docker compose, and have included the environment variable I'm not seeing any errors in any of the logs. Is this functionality that was working, and is no longer working, or am I doing something wrong? |
Replies: 2 comments 3 replies
|
The setting is working — it just doesn't hide the button. Try actually submitting the registration form and you should get a 405. The backend enforces it in def _is_disabled(self, tree: Optional[str]) -> bool:
"""Check if the registration is disabled."""
if current_app.config["REGISTRATION_DISABLED"]:
return Trueif self._is_disabled(tree=args.get("tree")):
abort_with_message(405, "Registration is disabled")so The reason the UI doesn't reflect it is that the frontend has no way to find out. The only place the server advertises its configuration is the "server": {
"multi_tree": is_multi_tree,
"task_queue": has_task_queue,
"ocr": has_ocr,
"ocr_languages": ocr_languages,
"semantic_search": has_semantic_search,
"chat": has_chat,
},And even if it were listed there, that endpoint needs authentication — the login page is exactly where you don't have a token yet, so it couldn't consult it anyway. So this is a real gap, just a cosmetic one rather than a security one: the door is locked, the sign on it still says "come in". Worth filing against the API rather than the frontend, since hiding the button needs the flag exposed somewhere reachable before login before the frontend can act on it. |
The setting is working — it just doesn't hide the button. Try actually submitting the registration form and you should get a 405.
The backend enforces it in
gramps-web-api,api/resources/user.py:so
GRAMPSWEB_REGISTRATION_DISABLEDis doing its job. No accounts can be created.The reason the UI doesn't reflect it is that the frontend has no way to find out. The only place the server advertises its configuration is the
s…