How to avoid entering a route if it has not yet been authenticated, framework7 and vuejs?

Good evening.
I have the following route, where I receive a parameter through the ‘idservice’ route:

 {
        path: '/editarmiservicio/:idservicio',
        component: EditarMiServicio,
        beforeEnter: validacion
},

I have the following middleware:

    function validacion(to, from, next) {
      const router = this;
      let usuario = firebase.auth().currentUser;
      console.log("ESTA INTENTANDO INGRESAR A: ");
      console.log(to.url);
      if(to.url == '/mensajes/' || to.url == '/conversacion/' || to.url =="/editarmiservicio/:idservicio"){
        if(usuario){
          next();
        }
        else{
          router.navigate('/entrar/');
        }
      }
      else{
        next();
      }
    }

but the path to.url == "/ edit my service /: idservice" doesn’t work for me, since the console.log prints'edit my service / -Lh29vaFjkzi1Cu364pT', since: idservice is dynamic. Well, with the condition of validatingto.url == '/ messages /' if it works correctly.
Beforehand thank you very much.

How can I correct such a situation?

Beforehand thank you very much.

function validacion(to, from, resolve, reject) {
      const router = this;
      let usuario = firebase.auth().currentUser;
      console.log("ESTA INTENTANDO INGRESAR A: ");
      console.log(to.url);
      if(to.url == '/mensajes/' || to.url == '/conversacion/' || to.url =="/editarmiservicio/:idservicio"){
        if(usuario){
          resolve();
        }
        else{
          reject();
          router.navigate('/entrar/');
          return;
        }
      }
      else{
        resolve();
      }
    }