authWithPassword<T> method
Implementation
@override
Future<T> authWithPassword<T>({
required String identity,
required String password,
String? expand,
String? fields,
}) async {
try {
Client client = Client(
baseUrl,
collectionName: collectionName,
path: "/api/collections/${collectionName}/auth-with-password",
expand: expand,
fields: fields,
);
Map user = await client.post<Map>(body: {
"identity": identity,
"password": password,
});
Storage storage = Storage();
await storage.setAuth(
token: user['token'],
id: user['record']['id'],
userData: user['record']);
return user as T;
} catch (e) {
rethrow;
}
}