PHPackages                             madmikeyb/reauthenticate - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. madmikeyb/reauthenticate

AbandonedArchivedLibrary[Authentication &amp; Authorization](/categories/authentication)

madmikeyb/reauthenticate
========================

Reauthenticate users by letting them re-enter their passwords for specific parts of your app.

1.7.0(3y ago)039MITPHPPHP &gt;=5.5.9

Since Nov 10Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/MadMikeyB/reauthenticate)[ Packagist](https://packagist.org/packages/madmikeyb/reauthenticate)[ RSS](/packages/madmikeyb-reauthenticate/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (4)Versions (13)Used By (0)

Abandoned
=========

[](#abandoned)

Starting from Laravel 6, the framework ships with a built-in Illuminate\\Auth\\Middleware\\RequirePassword middleware aliased as password.confirm that does the same job.

Reauthenticate
==============

[](#reauthenticate)

Because sometimes, you want that extra layer of security
--------------------------------------------------------

[](#because-sometimes-you-want-that-extra-layer-of-security)

[![Software License](https://camo.githubusercontent.com/f251623e510f5909f16ae3f4e6e548dac11340b9fde1a99be26b015b39272c00/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c6174)](LICENSE.md)

Reauthenticate users by letting them re-enter their passwords for specific parts of your app (for Laravel 5).

```
Route::group(['middleware' => ['auth','reauthenticate']], function () {

    Route::get('user/payment', function () {
        // Needs to re-enter password to see this
    });

});
```

Note
----

[](#note)

This package is a fork of [mpociot/reauthenticate](https://github.com/mpociot/reauthenticate), with two extra features and the readme instructions updated to Laravel 5.5+ which is the new LTS version of Laravel.

**I do not take credit for this work, I simply forked it and modified it.** A PR was submitted but not addressed, thus, this fork was published to packagist.

Contents
--------

[](#contents)

- [Installation](#installation)
- [Usage](#usage)
- [Configuration](#configuration)
- [License](#license)

Installation
------------

[](#installation)

In order to add reauthenticate to your project, just run the following command in terminal:

```
composer require madmikeyb/reauthenticate

```

Usage
-----

[](#usage)

### Add the middleware to your Kernel

[](#add-the-middleware-to-your-kernel)

In your `app\Http\Kernel.php` file, add the reauthenticate middleware to the `$routeMiddleware` array.

```
protected $routeMiddleware = [
    // ...
    'reauthenticate'         => \Mpociot\Reauthenticate\Middleware\Reauthenticate::class,
    // ...
];
```

### Add the routes &amp; views

[](#add-the-routes--views)

By default, reauthanticate is looking for a route `auth/reauthenticate` and a view `auth.reauthenticate` that will hold a password field.

An example view can be copied from [here](https://github.com/mpociot/reauthenticate/blob/master/views/reauthenticate.blade.php). Please note that this file needs to be manually copied, because I didn't want to bloat this package with a service provider.

The HTTP controller methods can be used from the `Reauthenticates` trait, so your AuthController looks like this:

```
