Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

332
Views
Facing issue while using GoogleAuthProvider() method

How to use GoogleAuthProvider() method in angular app for authentication in login method?

     Angular version: ^12.2.7 
    "@angular/fire": "^7.0.4", 
    "firebase": "^9.1.0",
import { Injectable } from '@angular/core';
import { AngularFireAuth } from '@angular/fire/compat/auth';
// import { AngularFireAuth } from '@angular/fire/auth';
import { AngularFirestore } from '@angular/fire/compat/firestore';
import { ActivatedRoute, Router } from '@angular/router';
import { Observable, of } from 'rxjs';
import { switchMap } from 'rxjs/operators';
import { AppUser } from '../models/appuser';
import * as firebase from 'firebase/compat/app';
import { GoogleAuthProvider } from "firebase/auth";

I'm getting error at:

firebase.GoogleAuthProvider(). async login() { const returnUrl = this.route.snapshot.queryParamMap.get('returnUrl') || this.router.url; 
localStorage.setItem('returnUrl', returnUrl); 
const credential = await this.afAuth.signInWithPopup(new firebase.GoogleAuthProvider()); 
return this.updateUserData(credential.user); }

enter image description here

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can try importing GoogleAuthProvider like this:

import { GoogleAuthProvider } from "firebase/auth"

// ...signInWithPopUp(new GoogleAuthProvider())

If you want to use that firebase.auth namespace then you might have to downgrade Firebase to "8.X.X" or use compat version for imports:

// Add compat if using V9

import firebase from "firebase/compat/app"; 
import "firebase/compat/auth" 
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!