Skip to content

Commit 5d758ae

Browse files
committed
lost password didn't work
1 parent 365a56c commit 5d758ae

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/ampache.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ def register(self, username, fullname, password, email):
626626
return False
627627
return self.return_data(ampache_response)
628628

629-
def lost_password(self):
629+
def lost_password(self, auth):
630630
""" lost_password
631631
MINIMUM_API_VERSION=6.1.0
632632
@@ -641,8 +641,8 @@ def lost_password(self):
641641
)
642642
"""
643643
ampache_url = self.AMPACHE_URL + '/server/' + self.AMPACHE_API + '.server.php'
644-
data = {'action': 'goodbye',
645-
'auth': self.AMPACHE_SESSION}
644+
data = {'action': 'lost_password',
645+
'auth': auth}
646646
data = urllib.parse.urlencode(data)
647647
full_url = ampache_url + '?' + data
648648
ampache_response = self.fetch_url(full_url, self.AMPACHE_API, 'goodbye')
@@ -4064,7 +4064,9 @@ def execute(self, method: str, params=None):
40644064
case 'goodbye':
40654065
return self.goodbye()
40664066
case 'lost_password':
4067-
return self.lost_password()
4067+
if "user" in params and "email" in params:
4068+
params["auth"] = self.encrypt_string(params["email"], params["user"])
4069+
return self.lost_password(params["auth"])
40684070
case 'ping':
40694071
if not "ampache_url" in params:
40704072
params["ampache_url"] = self.AMPACHE_URL

0 commit comments

Comments
 (0)