mirror of
https://github.com/pezkuwichain/pezkuwi-telegram-miniapp.git
synced 2026-04-22 03:07:55 +00:00
debug: add auth logging to troubleshoot login issue
This commit is contained in:
@@ -66,8 +66,19 @@ serve(async (req) => {
|
||||
const body = await req.json();
|
||||
const { sessionToken, announcementId, reaction } = body;
|
||||
|
||||
console.log('[announcement-reaction] Request received:', {
|
||||
hasSessionToken: !!sessionToken,
|
||||
announcementId,
|
||||
reaction,
|
||||
});
|
||||
|
||||
// Validate input
|
||||
if (!sessionToken || !announcementId || !reaction) {
|
||||
console.error('[announcement-reaction] Missing fields:', {
|
||||
sessionToken: !!sessionToken,
|
||||
announcementId,
|
||||
reaction,
|
||||
});
|
||||
return new Response(JSON.stringify({ error: 'Missing required fields' }), {
|
||||
status: 400,
|
||||
headers: { ...corsHeaders, 'Content-Type': 'application/json' },
|
||||
@@ -87,12 +98,15 @@ serve(async (req) => {
|
||||
const botToken = Deno.env.get('TELEGRAM_BOT_TOKEN');
|
||||
|
||||
if (!botToken) {
|
||||
console.error('[announcement-reaction] TELEGRAM_BOT_TOKEN not set!');
|
||||
return new Response(JSON.stringify({ error: 'Server configuration error' }), {
|
||||
status: 500,
|
||||
headers: { ...corsHeaders, 'Content-Type': 'application/json' },
|
||||
});
|
||||
}
|
||||
|
||||
console.log('[announcement-reaction] Bot token available, verifying session...');
|
||||
|
||||
// Verify session token
|
||||
const telegramId = verifySessionToken(sessionToken, botToken);
|
||||
if (!telegramId) {
|
||||
|
||||
Reference in New Issue
Block a user