Skip to content

Commit 0b55fa2

Browse files
authored
Merge pull request #1042 from kenjis/docs-improve-force-reset
docs: improve force reset
2 parents d71090d + ec0161b commit 0b55fa2

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

docs/user_management/forcing_password_reset.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,24 @@
11
# Forcing Password Reset
22

3-
Depending on the scope of your application, there may be times when you'll decide that it is absolutely necessary to force user(s) to reset their password. This practice is common when you find out that users of your application do not use strong passwords OR there is a reasonable suspicion that their passwords have been compromised. This guide provides you with ways to achieve this.
3+
Depending on the scope of your application, there may be times when you'll decide
4+
that it is absolutely necessary to force user(s) to reset their password. This
5+
practice is common when you find out that users of your application do not use
6+
strong passwords OR there is a reasonable suspicion that their passwords have been
7+
compromised.
8+
9+
This guide provides you with ways to achieve this.
410

511
## Available Methods
612

7-
Shield provides a way to enforce password resets throughout your application. The `Resettable` trait on the `User` entity and the `UserIdentityModel` provides the following methods to do so.
13+
Shield provides a way to enforce password resets throughout your application.
14+
The `Resettable` trait on the `User` entity and the `UserIdentityModel` provides
15+
the following methods to do so.
16+
17+
!!! note
18+
19+
If a user is put into the force reset state, Shield does nothing by default.
20+
You need to check if a user requires password reset (see below), and set the
21+
redirect URL for the reset page, and create the reset page.
822

923
### Check if a User Requires Password Reset
1024

@@ -16,6 +30,11 @@ if ($user->requiresPasswordReset()) {
1630
}
1731
```
1832

33+
!!! note
34+
35+
You can use the [force-reset](../../references/controller_filters/#forcing-password-reset)
36+
filter to check.
37+
1938
### Force Password Reset On a User
2039

2140
To force password reset on a user, you can do so using the `forcePasswordReset()` method on the `User` entity.

0 commit comments

Comments
 (0)