当我将网站部署到 netlify 时,我无法正确登录,新的 google 窗口自动打开和关闭,我的网站时钟
function SignIn() {
const signInWithGoogle = () => {
const provider = new firebase.auth.GoogleAuthProvider();
auth.signInWithPopup(provider);
};
return (
<>
<button className="sign" onClick={signInWithGoogle}>
Sign in with Google
</button>
</>
);
Run Code Online (Sandbox Code Playgroud)
}
function SignOut() {
return (
auth.currentUser && (
<button className="sign" onClick={() => auth.signOut()}>
Sign Out
</button>
)
);
Run Code Online (Sandbox Code Playgroud)
}
只有在我将其部署到netlify上后,它才会在Web中发生,并且在本地服务器中正常工作