bootstrap-registration-toggle

Add an environment-variable-controlled registration toggle to a Phoenix 1.8 app.

1|Updated May 7, 2026
One-click install
npx skills add https://github.com/agoodway/GoodSkills --skill bootstrap-registration-toggle
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bootstrap-registration-toggle
Source: https://github.com/agoodway/GoodSkills/tree/main/skills/bootstrap-registration-toggle
Command: npx skills add https://github.com/agoodway/GoodSkills --skill bootstrap-registration-toggle

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Prevents users from signing up when your Phoenix app should restrict registration, while avoiding broken or confusing UI by making signup behavior controllable via environment configuration.

Core Features & Use Cases

  • ENV-controlled runtime toggle: Adds a runtime config value driven by an environment variable (including a boolean_env helper when missing) so registration can be enabled in dev/test and disabled in prod by default.
  • Controller guard for safety: Introduces a plug in the registration controller that redirects and flashes an error when registration is disabled.
  • Conditional login UI: Hides the "Sign up" link on the login page when registration is turned off, matching backend enforcement.

Use case: You deploy a production Phoenix 1.8 app and need to temporarily close new user registrations without removing auth routes, templates, or controller logic.

Quick Start

Ask an AI agent to run the bootstrap-registration-toggle skill on your Phoenix 1.8 app generated with phx.gen.auth so it adds an ENV-based registration toggle, protects the registration controller with a plug, and conditionally hides the signup link on the login page.

Frequently Asked Questions about bootstrap-registration-toggle

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I disable user registration in a Phoenix app without removing auth routes?

To disable new signups in Phoenix, set an environment variable in your runtime config to control a registration toggle, which applies a controller plug to block requests and uses Heex conditional rendering to hide the UI link.

What is the best way to toggle Phoenix signup availability between development and production?

The best way to toggle Phoenix signup availability is using runtime configuration driven by environment variables, letting you enable registration in dev and test while disabling it in production by default.

Can I use environment variables to control Phoenix runtime config for authentication features?

Yes, you can use environment variables to control Phoenix runtime config for auth by adding a boolean_env helper that reads the variable, letting you dynamically manage features like registration toggles without changing code.

How do I hide the signup link on the Phoenix login page when registration is closed?

You hide the signup link on the Phoenix login page by applying Heex conditional rendering based on the runtime config value, ensuring the UI matches the backend controller guard when registration is disabled.

Does this registration toggle approach work with Phoenix apps generated using phx.gen.auth?

Yes, this registration toggle approach works with Phoenix 1.8 apps generated using phx.gen.auth, applying discovery-first checks to add only missing pieces like the controller plug and runtime config without breaking existing auth logic.

Why should I use a controller plug instead of just hiding the signup form to prevent registration?

You should use a controller plug because hiding the signup form alone leaves the backend vulnerable, whereas a plug redirects requests and flashes an error when registration is disabled, ensuring consistent enforcement across controllers and login UI.