Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Password reset fails with 'ResetPasswordForm' object has no attribute 'user' #7500

Closed
thaDude opened this issue May 22, 2024 · 1 comment
Closed
Assignees
Milestone

Comments

@thaDude
Copy link

thaDude commented May 22, 2024

Describe the bug
When submitting the new password and password confirmation to /browser/reset_password the server responds with 500, the password is not reset.

To Reproduce

docker run -p 8000:80 \
    -e 'PGADMIN_DEFAULT_EMAIL=user@domain.com' \                                 
    -e 'PGADMIN_DEFAULT_PASSWORD=SuperSecret' \
    -d dpage/pgadmin4:8.6 

Steps to reproduce the behavior:

  1. Login with admin user and create a normal user.
  2. Open /browser/reset_password.
  3. Enter email address of user that was created.
  4. Receive mail and click on link.
  5. Enter new password/confirm then submit form.

Expected behavior
I expect the password to be reset without error.

Error message

{
  "success": 0,
  "errormsg": "'ResetPasswordForm' object has no attribute 'user'",
  "info": "",
  "result": null,
  "data": null
}

Desktop (please complete the following information):

  • OS: macOS 14.2.1 (23C71)
  • Version: 8.6
  • Mode: Server
  • Browser (if running in server mode): Chrome
  • Package type: Container

Additional context

Some more output from the server logs:

2024-05-22 17:42:09,594: ERROR  pgadmin:        'ResetPasswordForm' object has no attribute 'user'
Traceback (most recent call last):
  File "/venv/lib/python3.11/site-packages/flask/app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/venv/lib/python3.11/site-packages/flask/app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/venv/lib/python3.11/site-packages/flask_security/decorators.py", line 645, in wrapper
    return current_app.ensure_sync(f)(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/pgadmin4/pgadmin/browser/__init__.py", line 1111, in reset_password
  File "/venv/lib/python3.11/site-packages/flask_wtf/form.py", line 86, in validate_on_submit
    return self.is_submitted() and self.validate(extra_validators=extra_validators)
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/venv/lib/python3.11/site-packages/flask_security/forms.py", line 717, in validate
    self.password.data, False, user=self.user
                                    ^^^^^^^^^
AttributeError: 'ResetPasswordForm' object has no attribute 'user'

Thank you!

/David

@thaDude thaDude added the Bug label May 22, 2024
@pravesh-sharma pravesh-sharma self-assigned this May 23, 2024
pravesh-sharma added a commit to pravesh-sharma/pgadmin4 that referenced this issue May 24, 2024
…t link was not working. pgadmin-org#7500

2. Fixed an issue where the recover password button was enabled even when no email was provided. pgadmin-org#7487
pravesh-sharma added a commit to pravesh-sharma/pgadmin4 that referenced this issue May 24, 2024
…t link was not working. pgadmin-org#7500

2. Fixed an issue where the recover password button was enabled even when no email was provided. pgadmin-org#7487
adityatoshniwal pushed a commit that referenced this issue May 24, 2024
…t link was not working. #7500

2. Fixed an issue where the recover password button was enabled even when no email id was provided. #7487
@pravesh-sharma pravesh-sharma added this to the 8.7 milestone May 24, 2024
@pravesh-sharma pravesh-sharma removed their assignment May 24, 2024
@RohitBhati8269
Copy link
Contributor

Tested on snapshot build: 2024-05-20
OS: macOS
Version: 8.6
Mode: Server/Desktop
Browser: Chrome

Issue fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants