Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Filament Password Confirmation Laravel Package

kaantanis/filament-password-confirmation

Filament Password Confirmation adds Laravel-style password confirmation to Filament panels, prompting users to re-enter their password before sensitive actions. A simple way to protect critical admin operations and strengthen panel security.

View on GitHub
Deep Wiki
Context7

Getting Started

  • Treat this as a small, archived middleware package, not a full Filament authentication suite. First inspect the README, composer.json, the service provider, any config file, and especially the RequirePassword middleware source to confirm the actual middleware alias, config keys, redirect behavior, and supported Filament/Laravel versions.
  • Install only if you are on a compatible Laravel/Filament version: composer require kaantanis/filament-password-confirmation. Because the last release was 2022-11-14 and the repo is archived, pin the version and expect to fork or copy the middleware if you need changes.
  • Publish the package config if one is provided, e.g. php artisan vendor:publish --tag=filament-password-confirmation-config, then inspect the timeout/session key/redirect settings before enabling it.
  • Register or confirm the middleware alias in your HTTP kernel/bootstrap setup, then attach it to the Filament panel middleware stack or the specific route group that needs protection.
  • First use case: a long-lived admin session where users should be forced to re-enter their password before sensitive Filament routes after a configured idle or session-age threshold. Start by applying it to one panel or one sensitive route group, not globally.
  • Verify the flow manually: log in, age the session or wait past the configured threshold, visit a protected Filament page, confirm the password prompt/redirect works, then confirm the original destination is restored.

Implementation Patterns

  • Apply the middleware to Filament panel routes rather than every web route. In a Filament panel provider, add it to the panel middleware stack after session/auth middleware so Auth and session state are available.
  • Use route-group protection for narrower cases:
    Route::middleware(['web', 'auth', 'require-password'])->group(function () {
        // sensitive admin routes
    });
    
    Confirm the exact alias from the package service provider before using it.
  • Align the package timeout with config('session.lifetime') and your “remember me” policy. A password-confirmation window shorter than the session lifetime is the point; matching them exactly defeats the protection.
  • Keep the confirmation route, login route, logout route, health checks, asset routes, and any webhook endpoints outside the protected group to avoid redirect loops.
  • For multiple panels or guards, verify whether the package stores a single session timestamp or is guard-aware. If it is not guard-aware, either accept shared confirmation state or wrap/fork the middleware with a panel/guard-specific session key.
  • Handle Livewire and JSON requests deliberately. Filament is Livewire-heavy, so middleware that redirects to an HTML password-confirm page can break component requests that expect JSON. Test table filters, modals, file uploads, and form submissions after enabling the middleware.
  • Use the middleware as a “recent password confirmation” gate, not as MFA. It protects long sessions from casual reuse; it does not replace 2FA, session invalidation, or re-authentication for destructive actions.
  • Test with time manipulation rather than waiting:
    $this->travel(31)->minutes();
    $this->get('/admin')->assertRedirect('/password/confirm');
    
    Adjust the assertion to the package’s actual redirect/response.
  • If the package’s redirect target is hard-coded, prefer a small fork or wrapper middleware that returns your own named route or Filament modal/page. This is usually cleaner than overriding global exception behavior.

Gotchas and Tips

  • Archived status is the main risk. Do not assume Filament v3/v4 or Laravel 10/11 compatibility. Check composer.json constraints and run the full admin flow on a staging copy before adopting.
  • Middleware order matters. It must run after StartSession and authentication middleware, but before controllers/Livewire components that assume a confirmed password. A misplaced middleware may see no authenticated user or no session timestamp.
  • Watch for redirect loops when the password-confirmation route itself is protected or when the redirect target is inside the guarded group. Explicitly exclude the confirmation route and its POST handler.
  • Livewire requests may not follow normal browser redirects. If Filament components start failing silently, inspect the response status and Accept/X-Livewire headers, then adjust the middleware to return a JSON 423/401 response or a Filament-compatible redirect for those requests.
  • Session key collisions can occur across panels, guards, or apps sharing a session cookie. If users switch between admin panels, confirm whether one panel’s password confirmation unlocks another.
  • Remember-me cookies extend authentication but should not bypass password confirmation. Verify the package checks the confirmation timestamp independently of Auth::check().
  • Config caching can hide changes: after editing package config, run php artisan config:clear and php artisan cache:clear in local/staging debugging.
  • Password confirmation is not authorization. Pair it with policies/gates for sensitive actions; do not rely on a session flag alone for role or permission checks.
  • For extension, the most practical path is usually to copy the middleware into app/Http/Middleware, rename the session key, add guard/panel awareness, and own the redirect logic. Keep the package as reference rather than a long-term dependency.
  • Add regression tests around: unauthenticated access, authenticated-but-unconfirmed access, confirmed access, expired confirmation, AJAX/Livewire request, and excluded routes. These catch the common failure modes when Laravel or Filament is upgraded.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource