Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.x] Confirm password #5515

Merged
merged 3 commits into from
Oct 9, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,14 @@ When attaching the `auth` middleware to a route, you may also specify which guar
$this->middleware('auth:api');
}

#### Confirming Password

Laravel ships with a `password.confirm` middleware that allows you to protect routes with password confirmation. Adding the `password.confirm` middleware will first redirect users to a screen where they need to enter their password before they can continue. After they've successfully entered their password, they're redirected to the route they tried to access and their session is remembered for a default of three hours. This value can be changed with the `auth.password_timeout` config value.

Route::get('settings/security', function () {
// Users need to confirm their password before continuing...
})->middleware('password.confirm');
driesvints marked this conversation as resolved.
Show resolved Hide resolved

<a name="login-throttling"></a>
### Login Throttling

Expand Down
8 changes: 8 additions & 0 deletions validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,7 @@ Below is a list of all available validation rules and their function:
[Not Regex](#rule-not-regex)
[Nullable](#rule-nullable)
[Numeric](#rule-numeric)
[Password](#rule-password)
[Present](#rule-present)
[Regular Expression](#rule-regex)
[Required](#rule-required)
Expand Down Expand Up @@ -948,6 +949,13 @@ The field under validation may be `null`. This is particularly useful when valid

The field under validation must be numeric.

<a name="rule-password"></a>
#### password

The field under validation must match the current logged in user's password. You can also pass a specific guard as the first parameter:

'password' => 'password:api'

<a name="rule-present"></a>
#### present

Expand Down