Skip to content

Fix Magic Link registration respecting allow_registration - #422

Merged
ddon merged 3 commits into
BeamLabEU:devfrom
timujinne:dev
Mar 17, 2026
Merged

Fix Magic Link registration respecting allow_registration#422
ddon merged 3 commits into
BeamLabEU:devfrom
timujinne:dev

Conversation

@timujinne

Copy link
Copy Markdown
Contributor

Summary

  • Block Magic Link registration page when allow_registration setting is disabled — redirect to login with flash error
  • Disable Magic Link checkbox in authorization settings UI when registration is off, with visual hint "(registration disabled)"

Changes

Authorization Settings UI

  • Checkbox auto-disables and unchecks when allow_registration is false
  • Dimmed label with "(registration disabled)" hint

Magic Link Registration

  • Added allow_registration check in mount/3 — redirects to login if disabled
  • Prevents bypassing registration block via direct URL access

Test Plan

  • Pre-commit checks passed (compile, credo, dialyzer)
  • mix format clean
  • Manual: disable registration in settings → verify Magic Link checkbox is disabled
  • Manual: navigate to /users/register/magic-link with registration off → verify redirect to login

Functional page that requires a token query param — not suitable
for search engine indexing. Added alongside /checkout and /cart
in @default_exclude_patterns.
…ernal module rendering

- Remove hardcoded Newsletters card from modules.html.heex (was causing
  double-render when phoenix_kit_newsletters package is installed)
- Enrich load_external_modules/1 with required_modules and admin_links fields
- External module card now shows "Requires X" badges for unmet dependencies
- External module card shows action link buttons when module is enabled
- Add not_installed_keys MapSet assign to guard against double-render
- Add key field to known_external_packages entry for newsletters
- Block Magic Link registration page when allow_registration is disabled
- Redirect to login with flash error message
- Disable Magic Link checkbox in authorization settings when registration is off
- Show visual hint "(registration disabled)" on disabled checkbox
@ddon
ddon merged commit edd7999 into BeamLabEU:dev Mar 17, 2026
6 checks passed
ddon added a commit that referenced this pull request Mar 17, 2026
- Remove unused not_installed_keys assign from Modules LiveView
- Add allow_registration check in Magic Link handle_event for defense-in-depth
- Add PR #422 review docs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants