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 ability to disable registrations #1824

Merged
merged 8 commits into from
Aug 9, 2024
Merged

Conversation

pixeldesu
Copy link
Member

A little present to the people that decide to host Retrospring themselves.

This is handled via a new configuration option in justask.yml:

features:
  registration:
    enabled: true

Removes all mentions of signing up from the interface (I hope) and redirects away from the sign up/user creation routes if they are tried to be accessed.


Important: This doesn't come with an invite system, so to create users you either temporarily enable registrations again, or create them manually over RailsAdmin.

@pixeldesu pixeldesu requested a review from nilsding as a code owner August 9, 2024 03:59
@github-actions github-actions bot added the feature Pull Requests that add a feature label Aug 9, 2024
@pixeldesu
Copy link
Member Author

Rubocop smh:

  • Complains about a not defined new in before action condition
  • Defining the above would literally just be a new action with super
  • Rubocop strips that because that's redundant

@nilsding I'm out of clues why the redirect doesn't seem to apply to the create action POST request. Maybe you have an idea.

@nilsding
Copy link
Member

nilsding commented Aug 9, 2024

One thing I noticed: the links in the sign in page still refer to "Sign up" as well

Copy link

codecov bot commented Aug 9, 2024

Codecov Report

Attention: Patch coverage is 93.33333% with 1 line in your changes missing coverage. Please review.

Project coverage is 95.91%. Comparing base (2001921) to head (49c4371).

Files Patch % Lines
app/controllers/user/registrations_controller.rb 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1824      +/-   ##
==========================================
+ Coverage   95.89%   95.91%   +0.01%     
==========================================
  Files         179      180       +1     
  Lines        2803     2816      +13     
==========================================
+ Hits         2688     2701      +13     
  Misses        115      115              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pixeldesu pixeldesu merged commit 1e267c8 into main Aug 9, 2024
11 checks passed
@pixeldesu pixeldesu deleted the feature/disable-registrations branch August 9, 2024 23:52
Copy link

sentry-io bot commented Aug 11, 2024

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ **ActionView::Template::Error: undefined method registrations_enabled' for Retrospring::Config:Module (ActionView::Template::Er...** UserController#show` View Issue

Did you find this useful? React with a 👍 or 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Pull Requests that add a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants