lost-password-reset: "LogicException: The controller result claims to be providing relevant cache metadata, but leaked metadata was detected."

Created on 13 December 2022, over 1 year ago
Updated 22 September 2023, 9 months ago

Problem/Motivation

When posting to following endpoint /user/lost-password-reset?_format=json, following error is thrown:
LogicException: The controller result claims to be providing relevant cache metadata, but leaked metadata was detected. Please ensure you are not rendering content too early. Returned object class: Drupal\rest\ResourceResponse. in Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (line 154 of /var/www/stage.taminatherme.ch.netnode.cloud/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php).

Steps to reproduce

make a post request to /user/lost-password-reset?_format=json with temp_pass, new_pass and name

Proposed resolution

Because it is a Post request we need to use ModifiedResourceResponse instead of ResourceResponse

πŸ› Bug report
Status

Fixed

Version

8.1

Component

Code

Created by

πŸ‡¨πŸ‡­Switzerland yannickbaettig

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024