mirror of
https://github.com/pezkuwichain/pezkuwi-telegram-miniapp.git
synced 2026-06-14 06:21:02 +00:00
debug: add early auth logging
This commit is contained in:
@@ -20,11 +20,19 @@ export function AuthProvider({ children }: { children: ReactNode }) {
|
||||
const [authError, setAuthError] = useState<string | null>(null);
|
||||
|
||||
const signIn = async () => {
|
||||
console.log('[Auth] signIn called');
|
||||
const tg = window.Telegram?.WebApp;
|
||||
console.log('[Auth] Telegram WebApp:', tg ? 'exists' : 'missing');
|
||||
console.log(
|
||||
'[Auth] initData:',
|
||||
tg?.initData ? `exists (${tg.initData.length} chars)` : 'MISSING'
|
||||
);
|
||||
|
||||
setAuthError(null);
|
||||
setIsLoading(true);
|
||||
|
||||
if (!tg?.initData) {
|
||||
console.log('[Auth] No initData, setting error');
|
||||
setAuthError('No Telegram initData');
|
||||
setIsLoading(false);
|
||||
return;
|
||||
@@ -32,7 +40,6 @@ 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:', JSON.stringify(result));
|
||||
if (result?.user) {
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"version": "1.0.143",
|
||||
"buildTime": "2026-02-07T01:28:39.013Z",
|
||||
"buildNumber": 1770427719014
|
||||
"version": "1.0.145",
|
||||
"buildTime": "2026-02-07T01:39:54.983Z",
|
||||
"buildNumber": 1770428394984
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user