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
- Domain Verification Failed - Fastly Conf...
I am trying to add my subdomain api.getmyself.app to my Custom Domain, but I keep getting the error: Domain 'getmyself.app' is owned by another customer I have...
- Data not loading at the frontend
My App that has been working for weeks, ain't loading anything at the frontend anymore. I thought maybe the API key expired but it's not the case. Users are log...
- Do I need to upgrade my Appwrite plan?
So i am making a file hosting & sharing platform (voltzy.lol) and i am expecting approx 5-8 million visit per month and over 30 million uploads per month do i n...