I created a function to handle custom tokens. If I do the execution from the uppwrite platform everything works fine. if I make a request from postman or from the application client nothing gets anywhere. Or it generates errors.
Am I doing the function request correctly? Nothing comes through when I call this function.
export async function authenticateWithTelegram(webAppUser, username) { try { const response = await fetch('http://667eca820456a6e6a0fe.appwrite.global/', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Appwrite-Key': apiJWT }, body: JSON.stringify({ telegramUserId: webAppUser.toString(), telegramUsername: username, }), }); const data = await response.json(); console.log('Server response:', data);
const session = await account.createSession(userId, secret);
console.log('Session created:', session);
return session;
} catch (error) {
console.error('Authentication error:', error);
throw error;
}
}
Recommended threads
- Update User Error
```ts const { users, databases } = await createAdminClient(); const session = await getLoggedInUser(); const user = await users.get(session.$id); if (!use...
- apple exchange code to token
hello guys, im new here 🙂 I have created a project and enabled apple oauth, filled all data (client id, key id, p8 file itself etc). I generate oauth code form...
- How to Avoid Double Requests in function...
I'm currently using Appwrite's `functions.createExecution` in my project. I want to avoid double requests when multiple actions (like searching or pagination) a...