Merge pull request #8951 from meteor/abernix/clear-password-on-retry

Clear credentials before retry on initial `meteor deploy` password failure.
This commit is contained in:
Ben Newman
2017-08-02 08:42:33 -07:00
committed by GitHub
2 changed files with 32 additions and 0 deletions

View File

@@ -508,6 +508,7 @@ var doInteractivePasswordLogin = function (options) {
} else {
loginFailed();
if (options.retry) {
delete loginData.password;
Console.error();
continue;
} else {

View File

@@ -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);
});