Guest User

Untitled

a guest
Jul 21st, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. function login() {
  2. var provider = new firebase.auth.GoogleAuthProvider();
  3. firebase.auth().signInWithPopup(provider).then(function (result) {
  4. window.user = result.user;
  5. adminCheck();
  6. }).catch(function (error) {
  7. console.log(error.code, error.message);
  8. }); }
  9.  
  10. firebase.auth().onAuthStateChanged(function (user) {
  11. if (user) {
  12. window.user = user;
  13. reinitialized = true;
  14. refreshNotifications();
  15. } else {
  16. askForLogin();
  17. }
  18. });
Add Comment
Please, Sign In to add comment