Andrew Fletcher published: 19 May 2022 (updated) 30 May 2022 1 minute read
How to use the Drupal REST API to trigger I've forgot (need to change) my password.
POST: {domain}/user/password?_format=hal_json
Content-type: application/hal_json
Accept: application/hal+json
Or if you are using hal_json then use
POST: {domain}/user/password?_format=json
Content-type: application/json
Accept: application/json
Body
{
"mail": "your@yoursite.email"
}
All going well there will be no response.
Other responses
However, if you have sent an email that doesn't exist on the site, then the response will be text-based. Such as:
{
"message": "Unrecognized username or email address."
}
The user is blocked or not activated:
{
"message": "The user has not been activated or is blocked."
}
Related articles
Andrew Fletcher
•
26 Apr 2024
TypeError: Cannot assign null to property Drupal\views\Plugin\views\argument\ArgumentPluginBase::$operator of type string
I'm getting the following errorTypeError: Cannot assign null to property Drupal\views\Plugin\views\argument\ArgumentPluginBase::$operator of type string in Drupal\views\Plugin\views\argument\ArgumentPluginBase->unpackArgumentValue() (line 1302 of...
Andrew Fletcher
•
22 Apr 2024
Streamlined Drupal 10 Deployment: Best Practices for Stability and Security
Have you ever walked into a situation and marveled at how a site is still operational? Deployments that are riddled with fail-safes piled atop a shaky foundation. The real challenge lies in gradually persuading the team to embrace change to build a stable, robust deployment process aligned with...
Andrew Fletcher
•
21 Apr 2024
This command will help you spot any unusually large directories
The red flag was when I saw the server disk space is showing a site is taking up 57992.5 MB, where locally the site size is showing 957MB. There is something serious happening here and I need to establish the problem quickly. When dealing with a significant discrepancy in site size...