Password Confirmation plugin screenshot
Dark mode ready
Multilingual support
Supports v5.x

Password Confirmation

Prompt users to re-enter their password before performing sensitive actions.

Tags: Panel Authorization
Supported versions:
3.x
Julio Motol avatar Author: Julio Motol

Documentation

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Simplifies adding a secure password confirmation step to your admin panels.

  • Prompts users to re-enter their password before performing sensitive actions.
  • Increases security by preventing accidental or unauthorized actions due to long session times.
  • Easy to integrate and highly configurable.

#Installation

You can install the package via composer:

composer require juliomotol/filament-password-confirmation

Then add the plugin to your panel.

JulioMotol\FilamentPasswordConfirmation\FilamentPasswordConfirmationPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
       ->plugin(FilamentPasswordConfirmationPlugin::make());
}

You can configure the route name, uri, middleware and password timeout duration.

FilamentPasswordConfirmationPlugin::make()
    ->routeName('confirm')
    ->routeUri('auth/confirm')
    ->routeMiddleware(FooMiddleware::class) // Accepts string|array
    ->passwordTimeout(10800) // Accepts int|null that represents the amount of seconds

Optionally, you can publish the translations and views using.

php artisan vendor:publish --tag="filament-password-confirmation-translations"
php artisan vendor:publish --tag="filament-password-confirmation-views"

#Usage

Simply use RequiresPasswordConfirmation in your pages/resources.

use JulioMotol\FilamentPasswordConfirmation\RequiresPasswordConfirmation;

class AdminResource extends Resource
{
    use RequiresPasswordConfirmation;
    ...
}

You can configure the password confirmation timeout within your page/resource.

use JulioMotol\FilamentPasswordConfirmation\RequiresPasswordConfirmation;

class AdminResource extends Resource
{
    use RequiresPasswordConfirmation;

    protected static ?int $passwordTimeout = 360; // the amount of seconds
    ...
}

NOTE: The password timeout duration is determined in the following order until it encounters a non-null value.

  1. $passwordTimeout property in the page/resource
  2. passwordTimeout() configured in the plugin during registry
  3. auth.password_timeout config assigned in config/auth.php

#Testing

composer test

#Changelog

Please see CHANGELOG for more information on what has changed recently.

#Contributing

Please see CONTRIBUTING for details.

#Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

#Credits

#License

The MIT License (MIT). Please see License File for more information.

The author

Julio Motol avatar Author: Julio Motol

Full-stack web developer with a passion (addiction) for building things. Constantly thinking of ways to do things better, faster and most importantly, cleaner.

Plugins
1
Stars
21