From 3f66a85c46f36fb79306b5b6cb70901cca2b8333 Mon Sep 17 00:00:00 2001 From: Jesse Rosenberger Date: Fri, 14 Jul 2017 00:24:00 -0700 Subject: [PATCH 1/2] [test] Ensure Galaxy deploy login works properly. This implements a non-`galaxy` labeled test (which will run with normal CI tests) which tests that Galaxy login both fails and succeeds properly much in the same way that our existing auth tests run except for the `meteor deploy` command. --- tools/tests/login.js | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/tools/tests/login.js b/tools/tests/login.js index 3c3e9437de..82b678d834 100644 --- a/tools/tests/login.js +++ b/tools/tests/login.js @@ -122,3 +122,34 @@ selftest.define("login", ['net'], function () { run.matchErr("Login failed"); run.expectExit(1); }); + +// This is a Galaxy-related command (deploy), but still pretty auth-y. +selftest.define("login on deploy", ['net'], function () { + const s = new Sandbox; + + const appName = testUtils.randomAppName(); + + s.createApp(appName, "standard-app"); + s.cd(appName); + + let run = s.run("deploy", appName); + run.matchErr(/You must be logged in to deploy/); + + run.matchErr("Email:"); + run.write("test@test.com\n"); + + run.matchErr("Logging in as test."); + + run.matchErr("Password:"); + run.write("SoVeryWrong\n"); + run.waitSecs(commandTimeoutSecs); + run.matchErr("Login failed"); + + run.matchErr("Password:"); + run.write("testtest\n"); + run.waitSecs(commandTimeoutSecs); + run.match("Talking to Galaxy servers"); + + // "test" user can't actually deploy, so it will still fail. + run.expectExit(1); +}); From 661b6f74e98e3163d23020e6c5f4f1f0c71f7ba7 Mon Sep 17 00:00:00 2001 From: Jesse Rosenberger Date: Thu, 13 Jul 2017 14:40:31 -0700 Subject: [PATCH 2/2] Clear password between retries when auth has failed. --- tools/meteor-services/auth.js | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/meteor-services/auth.js b/tools/meteor-services/auth.js index 2d2c043a6e..3660f42934 100644 --- a/tools/meteor-services/auth.js +++ b/tools/meteor-services/auth.js @@ -508,6 +508,7 @@ var doInteractivePasswordLogin = function (options) { } else { loginFailed(); if (options.retry) { + delete loginData.password; Console.error(); continue; } else {