mirror of
https://github.com/jonathan-martz/pocketbase-php-sdk.git
synced 2026-04-03 07:27:42 +00:00
add Settings Class, add authAsUser method for collection
This commit is contained in:
@@ -46,6 +46,19 @@ class Collection
|
||||
return json_decode($response, JSON_FORCE_OBJECT);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $email
|
||||
* @param string $password
|
||||
* @return void
|
||||
*/
|
||||
public function authAsUser(string $email, string $password)
|
||||
{
|
||||
$result = $this->doRequest($this->url . "/api/collections/users/auth-with-password", 'POST', ['identity' => $email, 'password' => $password]);
|
||||
if (!empty($result['token'])) {
|
||||
self::$token = $result['token'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $batch
|
||||
* @param array $queryParams
|
||||
|
||||
Reference in New Issue
Block a user