salomonsky commited on
Commit
ee40519
·
verified ·
1 Parent(s): 4c64685

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +12 -0
index.html CHANGED
@@ -265,6 +265,8 @@
265
  signInAnonymously,
266
  GoogleAuthProvider,
267
  signInWithPopup,
 
 
268
  signOut
269
  } from "https://www.gstatic.com/firebasejs/11.6.1/firebase-auth.js";
270
  import {
@@ -501,6 +503,16 @@
501
  }
502
  });
503
 
 
 
 
 
 
 
 
 
 
 
504
  // save username for new accounts (modal)
505
  saveUsernameButton.addEventListener('click', async () => {
506
  if (!userId) {
 
265
  signInAnonymously,
266
  GoogleAuthProvider,
267
  signInWithPopup,
268
+ signInWithRedirect,
269
+ getRedirectResult,
270
  signOut
271
  } from "https://www.gstatic.com/firebasejs/11.6.1/firebase-auth.js";
272
  import {
 
503
  }
504
  });
505
 
506
+ // Procesar posible resultado de Google Sign-In via redirect
507
+ try {
508
+ const redirectResult = await getRedirectResult(auth);
509
+ if (redirectResult && redirectResult.user) {
510
+ console.log('Google redirect completado para usuario:', redirectResult.user.uid);
511
+ }
512
+ } catch (redirectCheckErr) {
513
+ console.warn('Error al obtener resultado de redirect de Google:', redirectCheckErr);
514
+ }
515
+
516
  // save username for new accounts (modal)
517
  saveUsernameButton.addEventListener('click', async () => {
518
  if (!userId) {