import { getAuth, GoogleAuthProvider, signInWithPopup, signInWithRedirect, getRedirectResult, signOut, onAuthStateChanged } from "https://www.gstatic.com/firebasejs/10.8.0/firebase-auth.js"; // 로그인 버튼 클릭 시 모바일 여부 판단 및 처리 window.loginWithGoogle = () => { const isMobile = /iPhone|iPad|iPod|Android/i.test(navigator.userAgent); if (isMobile) { // 모바일 기기(아이폰 등)에서는 팝업 블록 완벽 회피를 위해 리다이렉트 로그인 사용 signInWithRedirect(auth, provider).catch(e => { if (e.code !== 'auth/cancelled-popup-request') { alert("로그인 실패: " + e.message); } }); } else { // PC 웹 환경에서는 기존처럼 팝업 로그인 사용 signInWithPopup(auth, provider).catch(e => { if (e.code !== 'auth/cancelled-popup-request') { alert("로그인 실패: " + e.message); } }); } };