1
0
mirror of https://github.com/delight-im/PHP-Auth.git synced 2025-08-20 06:41:30 +02:00

Re-implement internal throttling or rate limiting from scratch

This commit is contained in:
Marco
2017-08-19 00:22:21 +02:00
parent c1bb10f58d
commit a66312bbcf
5 changed files with 190 additions and 178 deletions

View File

@@ -304,6 +304,9 @@ catch (\Delight\Auth\NotLoggedInException $e) {
catch (\Delight\Auth\InvalidPasswordException $e) {
// invalid password(s)
}
catch (\Delight\Auth\TooManyRequestsException $e) {
// too many requests
}
```
Asking the user for their current (and soon *old*) password and requiring it for verification is the recommended way to handle password changes. This is shown above.
@@ -348,6 +351,9 @@ catch (\Delight\Auth\EmailNotVerifiedException $e) {
catch (\Delight\Auth\NotLoggedInException $e) {
// not logged in
}
catch (\Delight\Auth\TooManyRequestsException $e) {
// too many requests
}
```
For email verification, you should build an URL with the selector and token and send it to the user, e.g.:
@@ -541,6 +547,9 @@ try {
catch (\Delight\Auth\NotLoggedInException $e) {
// the user is not signed in
}
catch (\Delight\Auth\TooManyRequestsException $e) {
// too many requests
}
```
### Roles (or groups)