Skip to content

Enhance user messaging and refactor authentication components - #49

Merged
roble merged 5 commits into
mainfrom
poliglot
Aug 24, 2026
Merged

roble merged 5 commits into
mainfrom
poliglot

Conversation

@roble

@roble roble commented Aug 24, 2026 •

Copy link
Copy Markdown
Collaborator

This pull request introduces configurable magic link authentication settings and refactors the authentication card layout to use a shared core component in both React and Vue implementations. It also improves the user experience on the email verification page and updates Filament admin navigation and settings management for authentication.

Magic Link Authentication Configuration:

  • Magic link expiry is now configurable via new AuthSettings (with magic_link_enabled and magic_link_expiry), replacing the previous static config. Magic links default to a 15-minute expiry and can be managed by administrators through a new AuthenticationSettings Filament page. (CLAUDE.md [1] [2]; config/config.php [3]; database/settings/2026_07_30_160000_create_auth_settings.php [4]; src/Filament/Pages/AuthenticationSettings.php [5]; src/Http/Controllers/MagicLinkController.php [6]

Filament Admin Improvements:

  • Adds AuthenticationSettings page for managing magic link settings, and updates navigation icons and sort orders for authentication-related resources. Removes direct navigation group configuration from AuthPlugin. (CLAUDE.md [1]; src/Filament/AuthPlugin.php [2] [3]; src/Filament/Pages/AuthenticationSettings.php [4]; src/Filament/Resources/Users/UserResource.php [5] [6]

Authentication Card Layout Refactor:

  • Refactors both React and Vue AuthCardLayout components to use a shared CardLayout core component, simplifying code and allowing for consistent UI across modules. The wrapper remains for module-specific vocabulary and future customizations. (resources/js/react/layouts/AuthCardLayout.tsx [1] [2]; resources/js/vue/layouts/AuthCardLayout.vue [3] [4]

Email Verification Page UX Improvements:

  • Updates the email verification page in both React and Vue to have a more welcoming title, improved layout, and clearer instructions. Also tweaks button and link styling for consistency. (resources/js/react/pages/VerifyEmail.tsx [1] [2]; resources/js/vue/pages/VerifyEmail.vue [3] [4]

Minor UI and Code Cleanups:

  • Adjusts label class order for consistency in registration forms and cleans up imports in Vue app entry point. (resources/js/react/pages/Register.tsx [1]; resources/js/vue/pages/Register.vue [2]; resources/js/vue/app.ts [3]

Summary by CodeRabbit

  • New Features

    • Added an authentication settings page for administrators to enable or disable magic-link login and configure link expiration.
    • Magic links are enabled by default and expire after 15 minutes.
    • Added a success notification after email verification.
    • Improved translated welcome-email content.
  • Bug Fixes

    • Updated email-verification pages with clearer instructions and improved layout and styling.
    • Authentication screens now use consistent shared card layouts.
  • Tests

    • Expanded coverage for authentication settings, magic-link behavior, login, registration, logout, and email verification.

@coderabbitai

coderabbitai Bot commented Aug 24, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 0101ec88-d7fd-4688-b751-e8dcdd31b810

📥 Commits

Reviewing files that changed from the base of the PR and between 3b8f933 and 280af25.

📒 Files selected for processing (32)
  • CLAUDE.md
  • config/config.php
  • database/settings/2026_07_30_160000_create_auth_settings.php
  • resources/js/react/layouts/AuthCardLayout.tsx
  • resources/js/react/pages/Register.tsx
  • resources/js/react/pages/VerifyEmail.tsx
  • resources/js/vue/app.ts
  • resources/js/vue/layouts/AuthCardLayout.vue
  • resources/js/vue/pages/Register.vue
  • resources/js/vue/pages/VerifyEmail.vue
  • src/Filament/AuthPlugin.php
  • src/Filament/Pages/AuthenticationSettings.php
  • src/Filament/Resources/Users/UserResource.php
  • src/Http/Controllers/MagicLinkController.php
  • src/Http/Controllers/VerifyEmailController.php
  • src/Http/Middleware/EnsureMagicLinkEnabled.php
  • src/Notifications/MagicLinkNotification.php
  • src/Notifications/WelcomeNotification.php
  • src/Providers/AuthServiceProvider.php
  • src/Settings/AuthSettings.php
  • tests/Feature/AuthSettingsTest.php
  • tests/Feature/AuthenticationSettingsPageTest.php
  • tests/Feature/LoginTest.php
  • tests/Feature/MagicLinkTest.php
  • tests/e2e/pages/RegisterPage.ts
  • tests/e2e/tests/login/login.basic.spec.ts
  • tests/e2e/tests/login/logout.basic.spec.ts
  • tests/e2e/tests/magic-link/magic-link.config.spec.ts
  • tests/e2e/tests/magic-link/magic-link.settings.spec.ts
  • tests/e2e/tests/register/register.basic.spec.ts
  • tests/e2e/tests/sidebar.spec.ts
  • tests/e2e/tests/verify-email/verify-email.basic.spec.ts
💤 Files with no reviewable changes (4)
  • config/config.php
  • src/Filament/AuthPlugin.php
  • tests/e2e/pages/RegisterPage.ts
  • tests/e2e/tests/magic-link/magic-link.config.spec.ts

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Magic-link enablement and expiry now use persisted AuthSettings values. Filament provides administrator controls. Authentication layouts and verification pages were updated in React and Vue. Feature and end-to-end tests now validate settings-based behavior and variable authentication destinations.

Changes

Authentication settings and authentication flow

Layer / File(s) Summary
Settings contract and administrator page
src/Settings/AuthSettings.php, database/settings/..., src/Filament/Pages/AuthenticationSettings.php, src/Filament/..., tests/Feature/AuthSettingsTest.php, tests/Feature/AuthenticationSettingsPageTest.php, CLAUDE.md
Added persisted enablement and expiry settings with 15-minute defaults. Added the Filament settings page, validation, authorization tests, and documentation. Updated authentication navigation metadata.
Magic-link settings integration
src/Http/..., src/Notifications/..., src/Providers/AuthServiceProvider.php, tests/Feature/LoginTest.php, tests/Feature/MagicLinkTest.php, tests/e2e/tests/magic-link/*
Replaced legacy configuration lookups with AuthSettings. Applied configured expiry to tokens and notification content. Added persisted-setting coverage.
Authentication presentation updates
resources/js/react/..., resources/js/vue/..., src/Http/Controllers/VerifyEmailController.php, src/Notifications/WelcomeNotification.php
Shared CardLayout now renders authentication cards. Verification content is split into localized paragraphs. Verification success uses a toast. Welcome notification text uses translations.
End-to-end authentication validation
tests/e2e/pages/RegisterPage.ts, tests/e2e/tests/login/*, tests/e2e/tests/register/*, tests/e2e/tests/sidebar.spec.ts, tests/e2e/tests/verify-email/*
Replaced fixed dashboard assertions with authentication-state checks, added response waits, skipped incompatible tenancy scenarios, and removed the configurable registration redirect endpoint.

Estimated code review effort: 4 (Complex) | ~45 minutes

Merge Risk: 🔵 Low · up to 280af

The new authentication settings tests may interfere with parallel test projects by sharing mutable settings, which could cause misleading or flaky verification results. The PR is mergeable with explicit owner awareness or follow-up to ensure project-wide test isolation.

Sequence Diagram(s)

sequenceDiagram
  participant Administrator
  participant AuthenticationSettings
  participant AuthSettings
  participant MagicLinkController
  participant MagicLinkNotification
  Administrator->>AuthenticationSettings: Save magic-link settings
  AuthenticationSettings->>AuthSettings: Persist settings
  MagicLinkController->>AuthSettings: Read expiry and enablement
  MagicLinkController->>MagicLinkNotification: Pass URL and expiry
  MagicLinkNotification-->>Administrator: Render expiry in email
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the authentication messaging enhancements and component refactoring included in the pull request.
Docstring Coverage ✅ Passed Docstring check was indeterminate for this PR — some files could not be analyzed in time. Not blocking.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch poliglot

Warning

Some tools did not complete. Review the errors below.

🔧 PHPStan (2.2.8)

Composer install failed: the lock file is not up to date with the latest changes in composer.json. Run composer update and commit the updated composer.lock.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@roble
roble merged commit 6bc36ef into main Aug 24, 2026
7 of 11 checks passed
@roble
roble deleted the poliglot branch August 25, 2026 07:36
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.

1 participant