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

Enable token authentication for change_password() #785

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

jirikuncar
Copy link
Contributor

Two changes:

  1. Enable changing password by providing token
  2. Provide new token in response to successful password change

closes #479

Previously, only @login_required was used, therefore token authentication could not be used to change the user password.
This enables updating saved token upon changing password without having to (log out and) log in again in order to get new auth token.
Allow token authentication for the change_password endpoint.
This makes it possible change passwords from a json request.

Related-to: pallets-eco#421
Signed-off-by: David Aguilar <[email protected]>
@jwag956
Copy link
Collaborator

jwag956 commented Apr 29, 2019

A couple subtle behavior changes that this exposes - possibly we should address those as well.

@login_required has some additional features:
a) it allows OPTIONS method (for CORS)
b) flask-login supports a LOGIN_DISABLED config variable (for testing).

This change alters those 2. My feeling is that it would be better to simply teach auth_required() to support the OPTIONS feature - not sure LOGIN_DISABLED is important?

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.

4 participants