server
server copied to clipboard
"Create Account" Button should be inactive/hidden when "globalSettings__disableUserRegistration=true"
Hi everyone,
The topic is not entirely new and an attempt has already been made to address it with issue #631 . Unfortunately the task was closed.
But I would still be of the opinion that it would make sense to deactivate the "Create Account" button and hide it as soon as the config option globalSettings__disableUserRegistration is set to "true".
At the moment it is possible to enter all data including email, username and password and only on submitting the register form user gets an error toast. This is somehow unnecessary and also arouses false expectations among users
I'm taking a look but "Create Account" button is rendered in the https://github.com/bitwarden/web SPA so there's no good solution for hiding "Create Account" by configuration from the backend.
Any thoughts @eliykat?
hantatsang is correct, this would likely need to be a compile-time item, OR an additional API call, which seems like a bit of overhead for this purpose (and could potentially cause some odd behavior/conflicts). I'm inclined to say at this juncture this can't be done without some redesign in how configuration could possibly feed the web vault (which we've had requests for in other areas like SSO); which would be a broader topic, with that, this would likely need to be shelved until a future date.
Added good first issue
-label and pointing to the information I provided with https://github.com/bitwarden/server/issues/631#issuecomment-1262441797
Hi @LuxFerre86 is this issue still open can I work on it?
If removing / hiding the link on main page (web SPA) is too much overhead, what about having the registration dialog change to immediately inform the user that registrations are disabled? (Or is this also baked in to the SPA?)
Hiding the Create Account button should now be doable:
- server: update the
ConfigResponseModel
returned by theConfigController
to includeGlobalSettings.DisableUserRegistration
- client: subscribe to
configService.serverConfig$
to retrieve that value and hide the button if required.
CC @jlf0dev as Auth Team lead in case you have anything to add.
EDIT: this issue is fairly old and I'm not aware of anyone working on it. I think it's up for grabs.
Still waiting for resolving this issue.
I've created a couple of Pull Requests to Hide the "Create Account" when the "globalSettings__disableUserRegistration=true". Pending review...
https://github.com/bitwarden/server/pull/3636 https://github.com/bitwarden/clients/pull/7429