Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 967168d

Browse files
committed
skip sending password on change password endpoint
1 parent 65801af commit 967168d

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

auth0/v3/authentication/database.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,17 @@ def signup(self, client_id, email, password, connection, username=None, user_met
9292

9393
def change_password(self, client_id, email, connection, password=None):
9494
"""Asks to change a password for a given user.
95+
96+
client_id (str): ID of the application to use.
97+
98+
email (str): The user's email address.
99+
100+
connection (str): The name of the database connection where this user should be created.
95101
"""
96102
body = {
97103
'client_id': client_id,
98104
'email': email,
99105
'connection': connection,
100106
}
101-
if password:
102-
body.update({'password': password})
103-
107+
104108
return self.post('https://{}/dbconnections/change_password'.format(self.domain), data=body)

auth0/v3/test/authentication/test_database.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ def test_signup(self, mock_post):
9494
def test_change_password(self, mock_post):
9595
d = Database('my.domain.com')
9696

97+
# ignores the password argument
9798
d.change_password(client_id='cid',
9899
99100
password='pswd',
@@ -106,6 +107,5 @@ def test_change_password(self, mock_post):
106107
self.assertEqual(kwargs['data'], {
107108
'client_id': 'cid',
108109
'email': '[email protected]',
109-
'password': 'pswd',
110110
'connection': 'conn',
111111
})

0 commit comments

Comments
 (0)