How to fix register and login

I’m trying to connect firebase with my vue3 project. I want to build a register and login in my website. I can see the register in firebase web, but when I register a user, route.push is not working to redirect on “/”.

Here is my code:

Register

export default {
  name: "register",
  data: function () {
    return {
      form: {
        email: "",
        password: "",
      },
      error: null,
    };
  },
  methods: {
    register: function (e) {
      const auth = getAuth();
      createUserWithEmailAndPassword(auth, this.form.email, this.form.password)
        .then((userCredential) => {
          userCredential.user
            .updateProfile({
              displayName: this.form.email,
            })
            .then(() => {
              alert("User successfully registered!");
              this.$router.push("/login");
            });
        })
        .catch((error) => {
          const errorCode = error.code;
          const errorMessage = error.message;
          console.log(errorCode);
          console.log(errorMessage);
        });
      e.preventDefault();
    },
  },
};

Login

export default {
  name: "login",
  data: function () {
    return {
      user: {
        email: "",
        password: "",
      },
      error: null,
    };
  },
  methods: {
    login: function (e) {
      const auth = getAuth();
      signInWithEmailAndPassword(auth, this.user.email, this.user.password)
        .then((userCredential) => {
          userCredential.$router.replace({ name: "Home" }).then(() => {
            this.$router.push("/");
          });
        })
        .catch((error) => {
          const errorCode = error.code;
          const errorMessage = error.message;
          console.log(errorCode);
          console.log(errorMessage);
        });
      e.preventDefault();
    },
  },
};

When u do a register, the website have to redirect you to /. When you log in it has to redirect you to 7 too.

I have a problem with login because it is not working. I can’t log in with an existed user.

Any help?¿

Thanks