NEXT_PUBLIC_DISABLE_REGISTRATION=true does not prevent user signup
Author: trijsteCreated Nov 8, 2025Updated Sep 26, 2026
Labelsbug
When NEXT_PUBLIC_DISABLE_REGISTRATION=true is set in the .env file as documented, the registration UI and functionality remain fully accessible and functional. Users can still create accounts despite the environment variable being configured correctly.
Expected Behavior
Setting NEXT_PUBLIC_DISABLE_REGISTRATION=true should completely disable user registration, hiding the Sign Up link and blocking account creation attempts.
Actual Behavior
- The "Sign Up" link remains visible on the login page
- The
/registerpage is accessible - Users can successfully create new accounts via the registration form
- The environment variable appears to have no effect
Steps to Reproduce
- Set
NEXT_PUBLIC_DISABLE_REGISTRATION=truein.env - Run
docker compose down && docker compose up -d(as documented) - Access the Linkwarden instance
- Click "Sign Up" on the login page
- Fill out the registration form and submit
- Account is successfully created
Environment
- Linkwarden version: latest (as of 2025-11-08)
- Deployment method: Docker Compose
NEXT_PUBLIC_DISABLE_REGISTRATION=trueset in.env
Workaround
Until this is fixed, registration can be blocked using a Cloudflare Worker (or similar reverse proxy) to:
- Hide the Sign Up link via CSS injection
- Block the
/registerpage with a 403 response - Block registration API endpoints
export default {
async fetch(request) {
const url = new URL(request.url);
// Block only the register page
if (url.pathname === '/register') {
return new Response('Registration is disabled', {
status: 403,
headers: { 'Content-Type': 'text/plain' }
});
}
// Block only POST to /auth/register specifically
if (request.method === 'POST' && url.pathname === '/auth/register') {
return new Response(JSON.stringify({ error: 'Registration is disabled' }), {
status: 403,
headers: { 'Content-Type': 'application/json' }
});
}
// Pass everything else through
let response = await fetch(request);
// If it's an HTML page, inject CSS to hide signup link
if (response.headers.get('content-type')?.includes('text/html')) {
let html = await response.text();
const css = `<style>
[data-testid="register-link"] { display: none !important; }
</style>`;
html = html.replace('</head>', css + '</head>');
response = new Response(html, response);
}
return response;
}
}*worker code developed through inference model interrogation and may require further development.
Source: linkwarden/linkwarden