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

Add configuration to disable user registration #947

Merged
merged 6 commits into from
Aug 7, 2023

Conversation

irby
Copy link
Contributor

@irby irby commented Aug 3, 2023

Description

Work to address #911, add configuration to disable user signup functionality. By default, users will be able to signup. If account.allow_signup is set to false within the configuration, it will not allow users to register from the frontend or by calling the user create API.

Implementation

Added a new bool value to the configuration in the backend called AllowSignup that will be true by default.

On the backend, I added a check in the user create endpoint to check whether this config value is set to false. If so, it will return a 403 Forbidden response.

On the frontend, added a new page for when an account does not exist. This page does not include a button to register, it will only allow users to navigate back to the login screen. Users will only be redirected to this new screen if the config disallows user signups.

Tests

Added a test in the backend to verify that account creation is forbidden if account.allow_signup is disabled in the configuration. On the frontend side, I ran the application locally to verify new site behavior of signup is disabled. I could create an e2e test to test site navigation in an automated fashion, please let me know if I have authorization to update the GitHub action.

Todos

N/A

Additional context

N/A

Screenshots

image image

@sonatype-lift
Copy link

sonatype-lift bot commented Aug 3, 2023

Sonatype Lift is retiring

Sonatype Lift will be retiring on Sep 12, 2023, with its analysis stopping on Aug 12, 2023. We understand that this news may come as a disappointment, and Sonatype is committed to helping you transition off it seamlessly. If you’d like to retain your data, please export your issues from the web console.
We are extremely grateful and thank you for your support over the years.

📖 Read about the impacts and timeline

@like-a-bause
Copy link
Contributor

Hey Matt. Thanks a lot!
What do you mean by "let me know if I have authorization to update the GitHub action." What do you want to change? In general: Go for it, I think we have to approve such changes before anything gets executed.

@irby
Copy link
Contributor Author

irby commented Aug 4, 2023

@like-a-bause Added in an e2e test for the nosignup flow. Ready for re-review!

@lfleischmann
Copy link
Member

Hi @irby,

thanks! LGTM, will merge now.

@lfleischmann lfleischmann merged commit fe034c1 into teamhanko:main Aug 7, 2023
12 checks passed
@irby irby deleted the config-allow-disable-signup branch August 7, 2023 16:02
@FlxMgdnz
Copy link
Member

FlxMgdnz commented Aug 7, 2023

Thanks @irby - awesome work.

@FlxMgdnz
Copy link
Member

FlxMgdnz commented Aug 15, 2023

/tip $150 @irby

@teamhanko teamhanko deleted a comment from algora-pbc bot Aug 15, 2023
@teamhanko teamhanko deleted a comment from algora-pbc bot Aug 15, 2023
@algora-pbc
Copy link

algora-pbc bot commented Aug 15, 2023

@irby: You just got a $150 tip! 👉 Complete your Algora onboarding to collect your payment.

@irby
Copy link
Contributor Author

irby commented Aug 15, 2023

Hi @FlxMgdnz , thank you very much for the tip! Greatly appreciated. I've created an Algora account. How do I collect the tip?

@FlxMgdnz
Copy link
Member

Hey - you're welcome. You would have to create an account at Algora, which I can only recommend.

@algora-pbc
Copy link

algora-pbc bot commented Aug 15, 2023

🎉🎈 @irby has been awarded $150! 🎈🎊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants