Soft Login Required

Install this theme component

:waving_hand:

:light_bulb: What does this component do?

By default, Discourse gives you two main options: leave your site open to everyone, or lock it down completely using the login required site setting.

Soft Login Required bridges this gap by creating a flexible Soft Gate for your community:

:door: Redirection: Redirects anonymous visitors to /login. When they try to access topics it will redirect to /login (with a returnPath parameter).

:card_index: Topic Preview Card on Login Page: When redirected from a topic, a custom preview card is rendered directly on the /login page, showing guests a teaser/context of the topic they are about to unlock!

:magnifying_glass_tilted_right: SEO & Crawler Friendly: Search engine bots (Googlebot, Bingbot, etc.) bypass the frontend redirect entirely via Discourse’s native crawler detection, keeping your SEO rankings safe.

:prohibited: Route Exclusion Rules: Easily exclude specific paths or URL patterns with disabled_url setting using wildcards (e.g., /c/* or /about).


:camera_flash: How it works (User Flow)

Guest visits topic :right_arrow: Redirected to /login :right_arrow: Sees Topic Preview Card on Login Page :right_arrow: Logs in :right_arrow: Returned to exact topic URL


:warning: Important: Design Philosophy (Soft Login Required vs. Login Required)

Note on Security vs. UX:
This component acts as a Soft Login Gate designed for UX-level login prompts, age-verification compliance or community nudging while fully preserving SEO rankings.

Because Discourse core serves topic content to search crawlers for indexing, raw HTML/JSON remains accessible to non-JS clients by design. If your use case requires strict, server-side content isolation, please use Discourse’s built-in private categories or login required site setting instead.


Context: How I Revamped Our Forum's Visitor Flow

9 Likes