add a javascript function to handle de the connexion