#1485·linkwarden

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 /register page is accessible
  • Users can successfully create new accounts via the registration form
  • The environment variable appears to have no effect

Steps to Reproduce

  1. Set NEXT_PUBLIC_DISABLE_REGISTRATION=true in .env
  2. Run docker compose down && docker compose up -d (as documented)
  3. Access the Linkwarden instance
  4. Click "Sign Up" on the login page
  5. Fill out the registration form and submit
  6. Account is successfully created

Environment

  • Linkwarden version: latest (as of 2025-11-08)
  • Deployment method: Docker Compose
  • NEXT_PUBLIC_DISABLE_REGISTRATION=true set in .env

Workaround

Until this is fixed, registration can be blocked using a Cloudflare Worker (or similar reverse proxy) to:

  1. Hide the Sign Up link via CSS injection
  2. Block the /register page with a 403 response
  3. Block registration API endpoints
javascript
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.