javascript - immediate mode automatic login with firebase -


when user clicks login button login function called:

login: function() {         ref.auth.$authwithoauthpopup('facebook').then(user.setuser).catch(function(error) {           console.error('authentication failed: ', error);         });       } 

i use login button avoid popup blockers.

now everytime user visits site or refreshes page, have click login. there way of logging them in automatically / if have logged in before? way present login button if immediate login fails.

using $onauth(fn) method allow fire off function when user has logged in.

auth.$onauth(function(authdata) {   // fires off whenever user logs in }); 

this callback function still fire off when logged in user refreshes page.


Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -