I dont really understand why i am having this issues,
TypeScript
export default async ({ req, res }) => {
const client = new Client()
.setEndpoint(process.env.APPWRITE_ENDPOINT)
.setProject(process.env.APPWRITE_FUNCTION_PROJECT_ID)
.setKey(process.env.APPWRITE_API_KEY);
const users = new Users(client);
const { email } = JSON.parse(req.body);
const list = await users.list({
queries: [Query.equal('email', email)],
});
if (list.total === 0) {
return res.json({ provider: null });
}
const userId = list.users[0].$id;
const identities = await users.listIdentities(userId);
const provider = identities.identities.length
? identities.identities[0].provider
: null;
return res.json({ provider });
};
TL;DR
The developer is encountering an issue with an invalid `queries` parameter, which must be an array. The code snippet provided shows an attempt to list users based on a query but is missing an array for the query. To fix this, modify the `queries` parameter to an array like so:
```javascript
const list = await users.list({
queries: [[Query.equal('email', email)]],
});
```
This change should resolve the issue and allow the function to work correctly.Recommended threads
- Auth broken after update from 1.8.0 to 1...
So ive been having issues creating, deleting or updating users on my appwrite instance after i updated from 1.8.0 to version 1.9.0. When trying to create a user...
- User Blocked - False Positive
Today I tried to log in to my cloud console and it said the user is blocked and I didn't even receive any email regarding this like what kind of violation is my...
- Magic Link woes/noob
Magic Link is working; it sends the link to my email. But the link itself always leads to "Page Not Found. The page you're looking for doesn't exist". Clicking ...