Skip to content

Instantly share code, notes, and snippets.

@sudcha2
Created July 7, 2020 17:45
Show Gist options
  • Save sudcha2/4d1b2f368fadd5be7f3d8188868e6e85 to your computer and use it in GitHub Desktop.
Save sudcha2/4d1b2f368fadd5be7f3d8188868e6e85 to your computer and use it in GitHub Desktop.
Firebase Auth on Angular
import { AngularFireAuth } from '@angular/fire/auth';
constructor(private afAuth: AngularFireAuth) {
}
GoogleAuth() {
this.AuthLogin(new auth.GoogleAuthProvider());
}
AuthLogin(provider) {
return this.afAuth.signInWithPopup(provider)
.then((result) => {
this.generateAccessToken(true,result.user.displayName);
}).catch((error) => {
console.log(error)
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment