Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(signup): allow to block signup #3209

Merged
merged 7 commits into from
Jan 11, 2024
Merged

feat(signup): allow to block signup #3209

merged 7 commits into from
Jan 11, 2024

Conversation

arthurdotwork
Copy link
Contributor

fixes #3201.

I assumed that the flow would look like this; you start with the signup being enabled (which is the default value if the environment variable is not set), you first register to create the owner account/workspace and then, when you are done, you can now disable the registration of new users. There is still an exception; users who have a workspaceInviteHash are free to enter.

Copy link

github-actions bot commented Jan 3, 2024

Warnings
⚠️ Changes were made to the environment variables, but not to the documentation - Please review your changes and check if a change needs to be documented!

CLA

Hello there and welcome to our project!
By submitting your Pull Request, you acknowledge that you agree with the terms of our Contributor License Agreement.
Although we don't have a dedicated legal counsel, having this kind of agreement can protect us from potential legal issues or patent trolls.
Thank you for your understanding.

Generated by 🚫 dangerJS against ddac314

@FelixMalfait
Copy link
Member

Oh yes good catch on the inviteHash, forgot to mention that!

@arthurdotwork
Copy link
Contributor Author

Tests were failing since I had forgotten to update the service declaration. That should be OK now.

CleanShot 2024-01-03 at 10 52 22

Copy link
Member

@charlesBochet charlesBochet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, this is a great initiative.
I believe we also have some work on the frontend. Could you pass this environment variable value through ClientConfig. You will be able to get it in the frontend, store it in a recoilstate and use it in PageChangeEffect to prevent any user to access /sign-up route with no workspaceHash (you should redirect to /sign-in in this case)

@arthurdotwork
Copy link
Contributor Author

Hey there! 👋

Finally went through all of this GraphQL thing and was able to complete the frontend part.

CleanShot.2024-01-05.at.21.36.27.mp4

Copy link
Member

@charlesBochet charlesBochet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! I'm taking a final look and will merge it this morning :)

@charlesBochet
Copy link
Member

@arthureichelberger I have tested all cases and I have actually removed the override of checkUserExists in case of disabled sign up. This is preventing users to be added through inviteLink.

I feel the frontend approach is better now that we have it.
So it will still be possible to list users but I feel it's OK

@charlesBochet charlesBochet merged commit c6ae480 into twentyhq:main Jan 11, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add option to disable Signups
3 participants