Complete the code to initialize Firebase Authentication with Google as a social login provider.
const provider = new firebase.auth.[1]();GoogleAuthProvider is used to enable Google social login in Firebase Authentication.
Complete the code to trigger the social login popup using Firebase Authentication.
firebase.auth().signInWith[1](provider).then(result => { console.log(result.user); });signInWithPopup opens a popup window for social login, improving user experience and conversion.
Fix the error in the code to correctly handle the social login result.
firebase.auth().signInWithPopup(provider).then(result => { const user = result.[1]; console.log(user.email); });The user object is accessed via result.user to get user details like email.
Fill both blanks to create a function that triggers Google social login and handles errors.
function socialLogin() {
firebase.auth().signInWith[1](provider).catch(error => {
console.error('Login failed:', error.[2]);
});
}signInWithPopup triggers the login popup, and error.message provides the error description.
Fill all three blanks to create a Firebase config object with API key, authDomain, and projectId.
const firebaseConfig = {
apiKey: '[1]',
authDomain: '[2]',
projectId: '[3]'
};These three fields are essential for Firebase initialization: apiKey, authDomain, and projectId.