
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
- Google login error: {"message":"Invalid ...
hi, im trying to use google login with account.createOAuth2Session( 'google', 'profevardilla.pages.dev', 'profevardilla.pages.dev'...
- Auth Error
"use client"; import { useEffect } from "react"; import { getSessionCookie } from "@/actions/auth"; import { createBrowserSessionClient } from "@/lib/appwrite-...
- Prevent modifying specific attributes
How do I prevent user to only to be able to modify some of the attributes. Document level security gives full access to update whole document, what are the wor...
