gogole firebase code example
Example: firebase google yolo
<body>
<script src="https://smartlock.google.com/client"></script>
<app-root></app-root>
</body>
declare var googleyolo: any;
constructor(firebase: AngularAuthFirebase){}
const hintPromise = googleyolo.hint({
supportedAuthMethods: [
"https://accounts.google.com"
],
supportedIdTokenProviders: [
{
uri: "https://accounts.google.com",
clientId: "YOUR_GOOGLE_CLIENT_ID"
}
]
}).then((credential) => {
if (credential.idToken) {
const cred = firebase.auth.GoogleAuthProvider.credential(credential.idToken);
return firebase.auth().signInWithCredential(cred);
}
throw new Error;
}).then((result) => {
}).catch((error) => {
});
});