Skip to content

Commit 7bb6e97

Browse files
herihermwnHeri Hermawan
andauthored
Update: auth url and parameter for Admins (#16)
Co-authored-by: Heri Hermawan <[email protected]>
1 parent c829785 commit 7bb6e97

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ result = client.records.get_list(
3636
user_data = client.users.auth_via_email("[email protected]", "123456")
3737

3838
# or as admin
39-
admin_data = client.admins.auth_via_email("[email protected]", "123456")
39+
admin_data = client.admins.auth_with_password("[email protected]", "123456")
4040

4141
# and much more...
4242
```

pocketbase/services/admins.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def auth_response(self, response_data: dict) -> AdminAuthResponse:
3131
self.client.auth_store.save(token, admin)
3232
return AdminAuthResponse(token=token, admin=admin, **response_data)
3333

34-
def auth_via_email(
34+
def auth_with_password(
3535
self, email: str, password: str, body_params: dict = {}, query_params: dict = {}
3636
) -> AdminAuthResponse:
3737
"""
@@ -40,9 +40,9 @@ def auth_via_email(
4040
4141
On success this method automatically updates the client's AuthStore data.
4242
"""
43-
body_params.update({"email": email, "password": password})
43+
body_params.update({"identity": email, "password": password})
4444
response_data = self.client.send(
45-
self.base_crud_path() + "/auth-via-email",
45+
self.base_crud_path() + "/auth-with-password",
4646
{
4747
"method": "POST",
4848
"params": query_params,

0 commit comments

Comments
 (0)