server icon indicating copy to clipboard operation
server copied to clipboard

"Create Account" Button should be inactive/hidden when "globalSettings__disableUserRegistration=true"

Open LuxFerre86 opened this issue 3 years ago • 8 comments

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

LuxFerre86 avatar Apr 11 '21 12:04 LuxFerre86

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?

sangxxh avatar Apr 12 '21 08:04 sangxxh

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.

cscharf avatar Apr 12 '21 16:04 cscharf

Added good first issue-label and pointing to the information I provided with https://github.com/bitwarden/server/issues/631#issuecomment-1262441797

djsmith85 avatar Oct 13 '22 18:10 djsmith85

Hi @LuxFerre86 is this issue still open can I work on it?

rezakhan1 avatar Apr 09 '23 07:04 rezakhan1

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?)

RudeDude avatar Nov 19 '23 19:11 RudeDude

Hiding the Create Account button should now be doable:

  • server: update the ConfigResponseModel returned by the ConfigController to include GlobalSettings.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.

eliykat avatar Nov 21 '23 05:11 eliykat

Still waiting for resolving this issue.

netandreus avatar Dec 08 '23 14:12 netandreus

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

frederic11 avatar Jan 02 '24 22:01 frederic11