0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-11 02:59:07 +08:00
discourse/config
Régis Hanol 97e92041af
UX: Hide signup when the site is in read only or staff only mode (#42101)
Previously, a site in read only or staff only mode still offered
anonymous visitors every way in: the header "Sign Up" button, the signup
call to action at the end of a topic, the create account link on the
login page, and the server-rendered header — including the one on the
read only error page itself. Account creation is blocked in both modes,
so all of them were dead ends. The banner made it worse by describing
what members lose (replying, likes) rather than what an anonymous
visitor is actually unable to do.

This change gates the JS `canSignUp` getter and its Ruby twin
`can_sign_up?` on read only state, which covers every signup entry point
at once. `canSignUp` had to drop its `@computed` decorator to do so:
with no dependent keys it cached permanently, so the new term would have
been evaluated once at boot and then frozen — leaving the button visible
if read only mode started later, and hidden long after it ended.

The "Log In" button deliberately stays, because staff can still log in
during staff only mode. Anonymous visitors now get banner copy naming
signup and login instead, a refused login says only staff can log in
rather than claiming login is disabled outright, and the email and code
login forms show that inline instead of a generic "an error occurred"
dialog.

It also fixes a pre-existing blank page. Both `/login` and `/signup`
aborted the transition when read only, which on a direct URL load left
the application template unrendered — and with it the dialog holder, so
the explanation never appeared either. They now redirect home when there
is no route to stay on, and keep aborting when there is.

Meta ref: /t/408703
2026-07-28 20:05:04 +02:00
..
environments DEV: Enable Rails/FilePath rubocop rule (#40097) 2026-05-19 19:07:54 +02:00
imagemagick SECURITY: Harden imagemagick execution 2026-06-30 16:10:52 +02:00
initializers FIX: Load PostgreSQL structures in a single transaction (#42012) 2026-07-27 09:51:34 +08:00
locales UX: Hide signup when the site is in read only or staff only mode (#42101) 2026-07-28 20:05:04 +02:00
application.rb DEV: Retroactive review and refactor of custom emoji bulk import/export (#41860) 2026-07-22 10:06:54 +10:00
boot.rb DEV: Change test formatters (#39427) 2026-04-22 12:26:07 +02:00
cdn.yml.sample
database.yml DEV: Support per-unicorn-worker DB variable overrides (#35615) 2025-10-27 13:45:27 +08:00
deploy.rb.sample
dev_defaults.yml DEV: Add admin_dashboard:populate rake task to seed Site Traffic (#39775) 2026-05-06 12:07:47 +08:00
discourse.config.sample
discourse.pill.sample DEV: Move puma to test-only dependency (#38652) 2026-03-18 05:23:12 +08:00
discourse_defaults.conf FEATURE: Add opt-in IAM role assumption for S3 operations (#39174) 2026-04-15 04:29:50 +08:00
environment.rb DEV: Add env var for local email port (#36900) 2025-12-31 14:25:02 +10:00
logrotate.conf
multisite.yml.production-sample
nginx.sample.conf DEV: remove x-real-ip references (#41371) 2026-07-03 15:53:21 -04:00
official_plugins.json DEV: Remove deprecated themes/plugins from the list (#41948) 2026-07-23 13:06:14 +02:00
pitchfork.conf.rb DEV: Rename EmberCli to EmberAssets (#40938) 2026-06-16 12:56:56 +02:00
projections.json DEV: Prepare for rename of app/assets/javascripts/ -> frontend/ 2025-10-22 16:24:11 +01:00
routes.rb FEATURE: Log staff actions for admin onboarding panel steps (#42032) 2026-07-24 14:43:01 -07:00
sidekiq.yml
site_settings.yml FEATURE: Upcoming change to lower the pending users reminder delay default (#42019) 2026-07-28 14:24:30 +02:00
spring.rb
thin.yml.sample
unicorn_launcher DEV: Enable Pitchfork by default (#37679) 2026-02-11 11:52:39 +01:00