Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

reset_password: handle JSON requests (#453) #836

Closed
wants to merge 6 commits into from
Closed

reset_password: handle JSON requests (#453) #836

wants to merge 6 commits into from

Conversation

mephi42
Copy link

@mephi42 mephi42 commented Apr 6, 2019

Another stab at #468 and #535.

Fixes AttributeError when running test_custom_change_url and test_without_babel.
Fixes AttributeError: 'EnvironBuilder' object has no attribute 'find'
when using REQUIREMENTS=lowest.
This will hopefully help debug the weird

E       AssertionError: assert 1 == 0
E        +  where 1 = <Result InvalidRequestError('When initializing mapper mapped class User->user,...ss \'conftest.User\'> class after both dependent classes have been defined.',)>.exit_code

in test_cli_addremove_role with pypy2.
@mephi42
Copy link
Author

mephi42 commented Apr 10, 2019

@lnielsen Could you please take a look at this PR?

Copy link

@jwag956 jwag956 left a comment

Choose a reason for hiding this comment

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

I did something similar in:
https://github.com/jwag956/flask-security which is my fork.

I was solving the issue of a single-page-application which a) uses JSON api and b) needs redirect URls that are in fact API requests (not rendered HTML).
Since reset_password USUALLY comes in as a GET from an email confirmation - I needed to add redirect URLs/APIs.

I found your PR since I am getting my fork to build and hooked up to travis CI etc. And you have fixed a few other issues (thanks)!.

@mephi42
Copy link
Author

mephi42 commented Apr 25, 2019

@jwag956 this is my use case as well. Apparently quite a few people needed that in the past too, so I've decided to revive this topic.

@jirikuncar, @lnielsen, Gentle ping.

@jwag956
Copy link

jwag956 commented Apr 25, 2019

You can see my changes at: https://github.com/jwag956/flask-security/commits/develop

Also - in an effort to kickstart flask-security and get a release cadence going - I have formalized my fork - it is up on pypi, travis, readthedocs as flask-security-too.

My plan is to pick up obvious/easy already merged PRs from 'develop' branch to get started. Then improving my changes for json/APIs and getting those in.

@jwag956
Copy link

jwag956 commented May 28, 2019

I have merged my fix to this and confirmation, passwordless login that handle the case you are working on as well as other. In particular, for single-page-applications - the UI needs control on the GET on the reset password link. This will be part of my 3.2.0 release.

please see: Flask-Middleware/flask-security#81

I will have this up on pypi as a rc candidate in a day or so.

@mephi42
Copy link
Author

mephi42 commented May 28, 2019

That sounds really good, thanks! I will give it a try once it's on pypi.

@jwag956
Copy link

jwag956 commented May 28, 2019

@mephi42 It is now available as 3.2.0rc1 at:
https://pypi.org/project/Flask-Security-Too/#history

jasco pushed a commit to jasco/flask-security that referenced this pull request Oct 3, 2023
Co-authored-by: Chris Wagner <jwag.wagner@gmail.com>
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants