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
- Realtime is unable to connect for some r...
title basically. Here is the error: Ive noticed this happen when the tab is revisted after hibernated and a reload has not taken enough. To fix this you have ...
- End 2 End tests keep hitting rate limiti...
We have a CI/CD pipeline that runs our E2E test every time we commit a change to our PRs. We're consistently running into rate limiting issues. What are some so...
- is it possible to have a relationship bu...
i'm about to have many models, related to each other, and in most cases, i wouldn't like to get the whole tree... the whole model with it's relations, and rel...