Module breaks core's password reset form

Created on 5 July 2023, over 1 year ago

Problem/Motivation

change_pwd_page_form_alter() hides the password fields of the password reset form.
The password reset form is actually the user_edit form with a specific form state.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

๐Ÿ‡ฉ๐Ÿ‡ชGermany mkalkbrenner ๐Ÿ‡ฉ๐Ÿ‡ช

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

Comments & Activities

  • Issue created by @mkalkbrenner
  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany mkalkbrenner ๐Ÿ‡ฉ๐Ÿ‡ช
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Deepesh151086

    Hi @mkalkbrenner , this will break with password policy module. Attaching a new patch which resoves the problem.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia keshavv India

    keshav.k โ†’ made their first commit to this issueโ€™s fork.

  • @keshavk opened merge request.
  • Status changed to RTBC over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia keshavv India

    Patch #3 Failed to apply because there are some latest changes in the file.
    I have removed the Change Password tab when the user resets the password.
    The issue is also fixed. Please review the MR and merge.
    Thank you.

  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand thomasmurphy

    I tried the forked version from #6 but it didn't fix the issue for me.

  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia keshavv India

    When the user redirects to the Change password page from the email's One-time reset link.
    On that page, Fields were missing to reset passwords, Because this module will create a separate tab to update the password.

    When a user clicks on Update password tab, The URL changed and the token for resetting the password is removed from url. So the user is not able to reset the password.

    In the given MR I have moved the update password fields to the One-time login, edit profile page, So that the user can update the password on the same page, and it works for me.

    Please review.

  • Status changed to RTBC 6 months ago
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom c_archer Cumbria

    Tested the MR and it does add the password fields to the user edit page. Would it not be better to redirect the user to the user/change-password page?

  • Status changed to Needs review 2 months ago
  • ๐Ÿ‡น๐Ÿ‡ผTaiwan cobenash Taipei

    Hey folks,

    I have the same issue, and I checked the code on the module. I think the problem occurred because the path on the alter routes doesn't trigger the route change_pwd_page.reset successfully.

    change_pwd_page.reset:
      path: '/user/reset/{uid}/{timestamp}/{hash}/new/login'
      defaults:
        _controller: '\Drupal\change_pwd_page\Controller\ChangePwdPageController::resetPass'
        _title: 'Reset password'
      requirements:
        _access: 'TRUE'
      options:
        _maintenance_access: TRUE
        no_cache: TRUE
    

    Therefore, I modified the path, which seems to work as expected.

Production build 0.71.5 2024