Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit bfb9434

Browse files
committed
Merge pull request #58 from Microsoft/loginMessageChange
Login message change
2 parents b2c4193 + cf99698 commit bfb9434

File tree

1 file changed

+5
-16
lines changed

1 file changed

+5
-16
lines changed

cli/script/command-executor.ts

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ function deleteConnectionInfoCache(): void {
197197
try {
198198
fs.unlinkSync(configFilePath);
199199

200-
log("Deleted configuration file at '" + configFilePath + "'.");
200+
log("Successfully logged-out. The session token file located at " + chalk.cyan(configFilePath) + " has been deleted.\r\n");
201201
} catch (ex) {
202202
}
203203
}
@@ -476,15 +476,11 @@ function getDeploymentId(appId: string, deploymentName: string): Promise<string>
476476
}
477477

478478
function initiateExternalAuthenticationAsync(serverUrl: string, action: string): void {
479-
var message: string = "An internet browser will now launch to authenticate your identity.\r\n\r\n"
480-
+ "After completing in-browser authentication, please enter your access token to log in or use [CTRL]+[C] to exit.";
479+
var message: string = "A browser is being launched to authenticate your account. Follow the instructions it displays to complete the login.\r\n";
481480

482481
log(message);
483482
var hostname: string = os.hostname();
484483
var url: string = serverUrl + "/auth/" + action + "?hostname=" + hostname;
485-
486-
log("\r\nLaunching browser for " + url);
487-
488484
opener(url);
489485
}
490486

@@ -494,8 +490,6 @@ function login(command: cli.ILoginCommand): Promise<void> {
494490
sdk = new AccountManager(command.serverUrl);
495491
return sdk.loginWithAccessToken(command.accessKey)
496492
.then((): void => {
497-
log("Log in successful.");
498-
499493
// The access token is valid.
500494
serializeConnectionInfo(command.serverUrl, command.accessKey);
501495
});
@@ -522,8 +516,6 @@ function loginWithAccessTokenInternal(serverUrl: string): Promise<void> {
522516

523517
return sdk.loginWithAccessToken(accessToken)
524518
.then((): void => {
525-
log("Log in successful.");
526-
527519
// The access token is valid.
528520
serializeConnectionInfo(serverUrl, accessToken);
529521
});
@@ -558,10 +550,7 @@ function logout(command: cli.ILogoutCommand): Promise<void> {
558550

559551
return setupPromise
560552
.then((): Promise<void> => sdk.logout(), (): Promise<void> => sdk.logout())
561-
.then((): void => deleteConnectionInfoCache(), (): void => deleteConnectionInfoCache())
562-
.then((): void => {
563-
log("Log out successful.");
564-
});
553+
.then((): void => deleteConnectionInfoCache(), (): void => deleteConnectionInfoCache());
565554
}
566555

567556
return Q.fcall(() => { throw new Error("You are not logged in."); });
@@ -808,7 +797,7 @@ function requestAccessToken(): Promise<string> {
808797
prompt.get({
809798
properties: {
810799
response: {
811-
description: chalk.cyan("Enter your access token: ")
800+
description: chalk.cyan("Enter your access token: ")
812801
}
813802
}
814803
}, (err: any, result: any): void => {
@@ -838,7 +827,7 @@ function serializeConnectionInfo(serverUrl: string, accessToken: string): void {
838827
fs.writeFileSync(configFilePath, json, { encoding: "utf8" });
839828
}
840829

841-
log("Login token persisted to file '" + configFilePath + "'. Run 'code-push logout' to remove the file.");
830+
log("\r\nSuccessfully logged-in. Your session token was written to " + chalk.cyan(configFilePath) + ". You can run the " + chalk.cyan("code-push logout") + " command at any time to delete this file and terminate your session.\r\n");
842831
}
843832

844833
function tryBase64Decode(encoded: string): string {

0 commit comments

Comments
 (0)