Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static async signIn() {
- try {
- await GoogleSignin.hasPlayServices({ autoResolve: true });
- await GoogleSignin.configure(googleKeys);
- const { idToken } = await GoogleSignin.signIn();
- const provider = firebase.auth.GoogleAuthProvider;
- const credential = provider.credential(idToken);
- const data = await firebase.auth().signInWithCredential(credential);
- const user = {
- mail: data.email,
- photoURL: data.photoURL,
- name: data.displayName,
- };
- return user;
- } catch (err) {
- console.log(`There was an error in google signIn : ${err}`)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement