refacto authentification ws