Fully tested

This commit is contained in:
nemunaire 2023-04-13 06:56:07 +02:00
commit e9ecfccdb3
5 changed files with 43 additions and 27 deletions

View file

@ -1,3 +1,6 @@
import json
from urllib.parse import quote
class AuthUser:
def __init__(self, _session, Id, Email, EmailVerification, Password, CreatedAt, LastLoggedIn, AllowCommercials):
@ -14,9 +17,9 @@ class AuthUser:
def Delete(self):
self._session.authuser_delete(self.Id)
def ResetPassword(self, Id, NewPassword):
r = self.session.post(
"http+unix://" + self.socket_path + "/api/auth/" + quote_plus(Id) + "/reset_password",
def ResetPassword(self, NewPassword):
r = self._session.session.post(
"http+unix://" + self._session.socket_path + "/api/auth/" + quote(self.Id) + "/reset_password",
data=json.dumps({
"password": NewPassword,
})