gocrew/laravel-reauth

为应用程序敏感部分重新认证用户

v1.0.6 2016-04-29 15:15 UTC

This package is not auto-updated.

Last update: 2024-09-14 19:04:00 UTC


README

Build Status Latest Stable Version Latest Unstable Version License

为应用程序敏感部分重新认证用户。

安装

步骤 1: Composer

在命令行中运行

composer require gocrew/laravel-reauth

步骤 2: 服务提供者

对于您的 Laravel 应用,打开 config/app.php 文件,并在 providers 数组中追加

gocrew\LaravelReAuth\ServiceProvider::class

这将引导程序包进入 Laravel。

步骤 3: 中间件

在您的 app\Http\Kernel.php 文件中,将 reauth 中间件添加到 $routeMiddleware 数组中。

protected $routeMiddleware = [
    // ...
    'reauth'         => \gocrew\LaravelReAuth\Http\Middleware\Reauthenticate::class,
    // ...
];

用法

基本

在需要保护的路由上应用中间件

Route::get('settings', ['uses' => 'Controller@getSettings', 'middleware' => 'reauth']);

完成!

高级

如果您需要更高级的设置,没问题。一切都是可覆盖的,并且尽可能模块化。

待办事项

  • 高级文档
  • 测试

许可证

本存储库的内容在MIT 许可证下发布。