mirror of
https://github.com/pezkuwichain/pezkuwi-telegram-miniapp.git
synced 2026-07-09 23:47:24 +00:00
debug: improve error logging
This commit is contained in:
@@ -31,14 +31,17 @@ export function AuthProvider({ children }: { children: ReactNode }) {
|
||||
}
|
||||
|
||||
try {
|
||||
console.log('[Auth] Calling signInWithTelegram...');
|
||||
console.log('[Auth] initData length:', tg.initData?.length);
|
||||
const result = await signInWithTelegram(tg.initData);
|
||||
console.log('[Auth] signInWithTelegram result:', result);
|
||||
console.log('[Auth] signInWithTelegram result:', JSON.stringify(result));
|
||||
if (result?.user) {
|
||||
setUser(result.user);
|
||||
setAuthError(null);
|
||||
console.log('[Auth] User set:', result.user.first_name);
|
||||
} else {
|
||||
console.warn('[Auth] No user in result');
|
||||
setAuthError('No user returned from auth');
|
||||
}
|
||||
// Store session token for P2P and other cross-app auth
|
||||
if (result?.session_token) {
|
||||
|
||||
Reference in New Issue
Block a user