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

Improved password reset #228

Merged
merged 9 commits into from Mar 25, 2024
Merged

Improved password reset #228

merged 9 commits into from Mar 25, 2024

Conversation

mbodeantor
Copy link
Contributor

@mbodeantor mbodeantor commented Mar 20, 2024

Addresses #214
Reset tokens are now valid for 15 min, password reset email lists this fact
/reset-token-validation endpoint will check the reset token

Docs: https://app.gitbook.com/o/-MXypK5ySzExtEzQU6se/s/-MXyolqTg_voOhFyAcr-/~/changes/479/api/endpoints/admin

@joshuagraber
Copy link
Contributor

Nice @mbodeantor ty! You good if I push the client changes in this branch as well?

@mbodeantor
Copy link
Contributor Author

@joshuagraber For sure!

@mbodeantor mbodeantor linked an issue Mar 21, 2024 that may be closed by this pull request
Check token validity on page load
Add func to check validity of reset token
Update ResetPassword test
Update snapshots
Copy link
Contributor

@joshuagraber joshuagraber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed everything locally @mbodeantor. CC @josh-chamberlain if you want to run through the reset pw flow to test?

@josh-chamberlain josh-chamberlain merged commit 1b43305 into dev Mar 25, 2024
8 checks passed
@josh-chamberlain josh-chamberlain deleted the improved_password_reset branch March 25, 2024 16:15
@josh-chamberlain
Copy link
Contributor

@joshuagraber sorry, I thought of this after merging it into dev—on the reset password page, we should display the same requirements that we do on create. If you commit that to dev we can include it in #233

@joshuagraber
Copy link
Contributor

joshuagraber commented Mar 25, 2024

@josh-chamberlain Working on this, but something is erroring on dev right now when I try to run the app, which is making it kinda hard to test.

@mbodeantor does this look familiar to you?

Traceback (most recent call last):
  File "/Users/grabes/code/pdap/data-sources-app/app.py", line 12, in <module>
    from resources.DataSources import (
  File "/Users/grabes/code/pdap/data-sources-app/resources/DataSources.py", line 4, in <module>
    from middleware.data_source_queries import data_source_by_id_query, data_sources_query
  File "/Users/grabes/code/pdap/data-sources-app/middleware/data_source_queries.py", line 78, in <module>
    ) -> tuple[Any, ...] | None:
TypeError: unsupported operand type(s) for |: 'types.GenericAlias' and 'NoneType'

@mbodeantor
Copy link
Contributor Author

@maxachis

@maxachis
Copy link
Contributor

@mbodeantor @joshuagraber Yep, that's a product of my type hinting causing an error. Taking a look at it right now, and should hopefully have it resolved by tomorrow if not today. This error didn't come up in my running of tests, which either means I missed a test or existing tests aren't covering this code. That may be worth making an issue about.

@maxachis
Copy link
Contributor

maxachis commented Mar 26, 2024

@joshuagraber What Python version were you running on? The | should be valid for Python versions 3.10 and above, but would cause an error in 3.9 or lower.

Additionally, at the moment I do not see where a Python version is specified in the code. The tests.yaml file runs on version 3.11, so it would have missed this bug. Assuming my eyes do not deceive me (and they might), we may want to ensure the version is specified so as to avoid such issues in the future.

@maxachis maxachis mentioned this pull request Mar 26, 2024
@mbodeantor
Copy link
Contributor Author

mbodeantor commented Mar 27, 2024

@maxachis For local development, it is just based on the virtual env that is setup. In the build instructions in the README we are specifying 3.9 which as you point out does not match how we are having GitHub build, I updated the README to match.

@joshuagraber Give it a shot with a 3.11 virtualenv, also don't forget to update pdap_ds_start with the new env name!

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

Successfully merging this pull request may close these issues.

improve password reset experience
4 participants