reactjs - Kan inte logga in med Google via Firebase. Fel: Otillåten URL för nytt iframe
Kan inte logga in med Google med Firebase.
Okänt (i promise) Fel: Olaga URL för ny iframe - https://%22tweets-5df.firebaseapp.com%22%2C/__/auth/iframe?apiKey... vid _.yl (cb=gapi.loaded_0?le=scs:114:96) vid bm (cb=gapi.loaded_0?le=scs:124:18) vid _.cm (cb=gapi.loaded_0?le=scs:125:26) vid _.jm (cb=gapi.loaded_0?le=scs:130:147) vid _.An.openChild (cb=gapi.loaded_0?le=scs:207:378) vid _.An.open (cb=gapi.loaded_0?le=scs:212:12) vid _openIframe (iframe.ts:82:1) vid async BrowserPopupRedirectResolver.initAndGetManager (popup_redirect.ts:126:1)
.env
REACT_APP_PROJECT_ID = "tweets-5df"
REACT_APP_AUTH_DOMAIN ="tweets-5df.firebaseapp.com"
REACT_APP_STORAGE_BUCKET = "tweets-5df.appspot.com"
firebase.ts
import firebase from "firebase/compat/app";
import "firebase/compat/auth";
const {
REACT_APP_API_KEY,
REACT_APP_AUTH_DOMAIN,
REACT_APP_PROJECT_ID,
REACT_APP_STORAGE_BUCKET,
REACT_APP_SENDER_ID,
REACT_APP_APP_ID,
REACT_APP_MEASUREMENT_ID,
} = process.env;
const firebaseConfig = {
apiKey: REACT_APP_API_KEY,
authDomain: REACT_APP_AUTH_DOMAIN,
projectId: REACT_APP_PROJECT_ID,
storageBucket: REACT_APP_STORAGE_BUCKET,
messagingSenderId: REACT_APP_SENDER_ID,
appId: REACT_APP_APP_ID,
measurementId: REACT_APP_MEASUREMENT_ID,
};
firebase.initializeApp(firebaseConfig);
export const auth = firebase.auth();
const provider = new firebase.auth.GoogleAuthProvider();
provider.setCustomParameters({ prompt: "select_account" });
export const signInWithGoogle = () => auth.signInWithPopup(provider);
export default firebase;
<GoogleButton onClick={signInWithGoogle}> Sign in with google </GoogleButton>När jag klickar på Google-knappen visas "Error: Illegal url for new iframe" i konsolen. Kommer inte till autentiseringssidan.