Skip to content

fix(account): allow provider sign-up independently of DISABLE_SIGNUP - #11113

Open
MichaelUray wants to merge 1 commit into
hcengineering:developfrom
MichaelUray:fix/oidc-signup-disable-decouple
Open

MichaelUray wants to merge 1 commit into
hcengineering:developfrom
MichaelUray:fix/oidc-signup-disable-decouple

Conversation

@MichaelUray

Copy link
Copy Markdown
Contributor

Fixes #10915

Problem and change

The account service passed !hasSignUp, derived only from DISABLE_SIGNUP, into
registerProviders. Disabling password sign-up therefore also stopped first-time
users from getting an account through Google, GitHub or OpenID Connect. Many
self-hosted setups want the reverse: no open password sign-up, while the
identity provider stays in charge of who may join.

Add isProviderSignUpDisabled() in the account package and use it for the
auth providers. Provider sign-up still follows DISABLE_SIGNUP by default, so
existing deployments keep their behaviour. Setting ALLOW_PROVIDER_SIGNUP=true
keeps provider sign-up enabled while password sign-up stays disabled.
Invite/auto-join handling is unchanged. Document the variable next to
DISABLE_SIGNUP in the dev and ws-tests compose files and the VS Code launch
config, and add unit tests.

Tests

New unit tests in server/account/src/__tests__/utils.test.ts for isProviderSignUpDisabled() (default follows DISABLE_SIGNUP, ALLOW_PROVIDER_SIGNUP=true overrides it).

The account service passed !hasSignUp, derived only from DISABLE_SIGNUP, into
registerProviders. Disabling password sign-up therefore also stopped first-time
users from getting an account through Google, GitHub or OpenID Connect. Many
self-hosted setups want the reverse: no open password sign-up, while the
identity provider stays in charge of who may join.

Add isProviderSignUpDisabled() in the account package and use it for the
auth providers. Provider sign-up still follows DISABLE_SIGNUP by default, so
existing deployments keep their behaviour. Setting ALLOW_PROVIDER_SIGNUP=true
keeps provider sign-up enabled while password sign-up stays disabled.
Invite/auto-join handling is unchanged. Document the variable next to
DISABLE_SIGNUP in the dev and ws-tests compose files and the VS Code launch
config, and add unit tests.

Fixes hcengineering#10915

Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DisableSignup disables new user OIDC creation

1 participant