Skip to content

Commit

Permalink
Use same username as challenge parameters (NabuCasa#23)
Browse files Browse the repository at this point in the history
* Use same username as challenge parameters

* Adjusted layout

* Fixes for tests

* Fixes for tests
  • Loading branch information
circulon authored Jan 10, 2021
1 parent 6c173cf commit 0a18e88
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pycognito/aws_srp.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,12 @@ def set_new_password_challenge(self, new_password, client=None):
)

if tokens["ChallengeName"] == self.NEW_PASSWORD_REQUIRED_CHALLENGE:
challenge_parameters = response["ChallengeParameters"]
challenge_response.update(
{"USERNAME": auth_params["USERNAME"], "NEW_PASSWORD": new_password}
{
"USERNAME": challenge_parameters["USERNAME"],
"NEW_PASSWORD": new_password,
}
)
new_password_response = boto_client.respond_to_auth_challenge(
ClientId=self.client_id,
Expand Down

0 comments on commit 0a18e88

Please sign in to comment.