Created
July 7, 2020 17:45
-
-
Save sudcha2/4d1b2f368fadd5be7f3d8188868e6e85 to your computer and use it in GitHub Desktop.
Firebase Auth on Angular
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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