0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-06 11:36:31 +08:00
discourse/spec
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
..
db FIX: Prevent backslash accumulation in upload markdown labels (#39461) 2026-06-03 18:10:38 +02:00
fabricators PERF: Serve the activity_by_category report from daily rollups (#42046) 2026-07-28 12:53:29 +08:00
fixtures FIX: Strip SET transaction_timeout when restoring backups 2026-07-16 00:02:53 +00:00
generator DEV: Enable Rails/FilePath rubocop rule (#40097) 2026-05-19 19:07:54 +02:00
helpers UX: Hide signup when the site is in read only or staff only mode (#42101) 2026-07-28 20:05:04 +02:00
import_export
initializers DEV: Do not seed TOS and Privacy topics even if company_name is present (#41814) 2026-07-17 13:29:49 -04:00
integration FIX: store method in route matcher (#41512) 2026-07-07 11:49:56 -04:00
integrity DEV: hide and disable upcoming changes for disabled plugins (#41657) 2026-07-16 14:35:20 +04:00
jobs PERF: Serve the activity_by_category report from daily rollups (#42046) 2026-07-28 12:53:29 +08:00
lib SECURITY: Prevent cache poisoning/XSS via color scheme cookies 2026-07-28 16:40:22 +02:00
mailers DEV: remove simple email subject upcoming change metadata (#41807) 2026-07-20 14:43:00 +04:00
migrations FIX: Ensure each flag gets a unique name_key (#40899) 2026-06-24 16:37:59 +02:00
models SECURITY: Respect topic visibility in reviewable score serializer 2026-07-28 16:40:22 +02:00
multisite DEV: Enable Rails/FilePath rubocop rule (#40097) 2026-05-19 19:07:54 +02:00
queries/reports FEATURE: Change default upcoming change promotion status to Beta (#41275) 2026-07-06 09:13:37 +10:00
requests FIX: Validate resumableFilename in check_backup_chunk to prevent path traversa... (#42098) 2026-07-28 11:18:14 -05:00
script DEV: Fix UC status report when reverted files encountered (#41821) 2026-07-20 16:37:35 +10:00
serializers SECURITY: Stop exposing hidden tag names through category serializers 2026-07-28 16:40:22 +02:00
services FIX: Support uppercase in User Profile Website URL (#42072) 2026-07-28 09:27:03 -05:00
support DEV: Reset test site settings without callbacks (#41960) 2026-07-23 14:10:50 +08:00
system UX: Hide signup when the site is in read only or staff only mode (#42101) 2026-07-28 20:05:04 +02:00
tasks DEV: Make GHSA comparisons case-insensitive 2026-07-28 18:08:16 +02:00
views
rails_helper.rb DEV: Block external requests in system specs via Chrome DNS resolver (#40685) 2026-06-17 12:29:57 +01:00
regenerate_swagger_docs
swagger_helper.rb