Advertisement
Guest User

Untitled

a guest
Jul 30th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. signin(){
  2. var provider = new firebase.auth.GoogleAuthProvider();
  3. provider.addScope('https://www.googleapis.com/auth/plus.login');
  4. firebase.auth().signInWithPopup(provider).then(function(result) {
  5. // This gives you a Google Access Token. You can use it to access the Google API.
  6. var token = result.credential.accessToken;
  7. // The signed-in user info.
  8. var user = result.user;
  9. // ...
  10. }).catch(function(error) {
  11. // Handle Errors here.
  12. });
  13. }
  14.  
  15. var user = firebase.auth().currentUser;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement