Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. var user = firebase.auth().currentUser;
  2. if (user == null) {
  3. console.log("usuario nullo");
  4. window.open("index.html", "_self", true);
  5.  
  6.  
  7. } else { //Usuario Activo
  8.  
  9. //Codigo
  10.  
  11. firebase.auth().onAuthStateChanged(function(user) {
  12. if (user) {
  13. // El usuario está logueado, realiza acciones aquí
  14. } else {
  15. console.log("usuario nullo");
  16. location.replace("index.html");
  17. }
  18.  
  19. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement