Update: auth url and parameter for Admins (#16)

Co-authored-by: Heri Hermawan <heri.hermawan@bizhare.id>
This commit is contained in:
Heri Hermawan 2023-01-14 03:24:55 +07:00 committed by GitHub
parent c8297852ce
commit 7bb6e97880
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -36,7 +36,7 @@ result = client.records.get_list(
user_data = client.users.auth_via_email("test@example.com", "123456") user_data = client.users.auth_via_email("test@example.com", "123456")
# or as admin # or as admin
admin_data = client.admins.auth_via_email("test@example.com", "123456") admin_data = client.admins.auth_with_password("test@example.com", "123456")
# and much more... # and much more...
``` ```

View File

@ -31,7 +31,7 @@ class Admins(CrudService):
self.client.auth_store.save(token, admin) self.client.auth_store.save(token, admin)
return AdminAuthResponse(token=token, admin=admin, **response_data) return AdminAuthResponse(token=token, admin=admin, **response_data)
def auth_via_email( def auth_with_password(
self, email: str, password: str, body_params: dict = {}, query_params: dict = {} self, email: str, password: str, body_params: dict = {}, query_params: dict = {}
) -> AdminAuthResponse: ) -> AdminAuthResponse:
""" """
@ -40,9 +40,9 @@ class Admins(CrudService):
On success this method automatically updates the client's AuthStore data. On success this method automatically updates the client's AuthStore data.
""" """
body_params.update({"email": email, "password": password}) body_params.update({"identity": email, "password": password})
response_data = self.client.send( response_data = self.client.send(
self.base_crud_path() + "/auth-via-email", self.base_crud_path() + "/auth-with-password",
{ {
"method": "POST", "method": "POST",
"params": query_params, "params": query_params,