| Summary | Creating a flexible Soft Gate for your community | |
| Repository | GitHub - VaperinaDEV/soft-login-required: Creating a flexible Soft Gate for your community · GitHub | |
| Install Guide | How to install a theme or theme component | |
| New to Discourse Themes? | Beginner’s guide to using Discourse Themes |
Install this theme component
![]()
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:
Redirection: Redirects anonymous visitors to /login. When they try to access topics it will redirect to /login (with a returnPath parameter).
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!
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.
Route Exclusion Rules: Easily exclude specific paths or URL patterns with disabled_url setting using wildcards (e.g., /c/* or /about).
How it works (User Flow)
Guest visits topic
Redirected to /login
Sees Topic Preview Card on Login Page
Logs in
Returned to exact topic URL
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 requiredsite setting instead.
