From 158c915c977137805dcdb464d4d2fbe12869879e Mon Sep 17 00:00:00 2001 From: doubleface Date: Fri, 9 Nov 2018 16:42:35 +0100 Subject: [PATCH] fix: properly detect wront username or password --- src/index.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/index.js b/src/index.js index fbd77d7..30dc568 100755 --- a/src/index.js +++ b/src/index.js @@ -38,10 +38,7 @@ function authenticate(username, password) { url: `https://secure.fr.vente-privee.com/authentication/login/FR?ReturnUrl=https%3a%2f%2fsecure.fr.vente-privee.com%2fns%2ffr-fr%2fhome%2fdefault%2fclassic`, formSelector: 'form#authenticationForm', formData: { Mail: username, Password: password }, - validate: statusCode => { - log('info', statusCode) - return statusCode === 200 || log('error', 'Invalid credentials') - } + validate: (statusCode, $) => !$('#mdp').length }) }