Only output password if it was generated

This commit is contained in:
Asher 2019-04-25 14:08:46 -05:00
parent 58cf109a83
commit a3ac4567e3
No known key found for this signature in database
GPG Key ID: 7BB4BA9C783D2BBC
1 changed files with 2 additions and 1 deletions

View File

@ -216,6 +216,7 @@ const bold = (text: string | number): string | number => {
}
let password = options.password || process.env.PASSWORD;
const usingCustomPassword = !!password;
if (!password) {
// Generate a random password with a length of 24.
const buffer = Buffer.alloc(12);
@ -304,7 +305,7 @@ const bold = (text: string | number): string | number => {
logger.warn("Documentation on securing your setup: https://github.com/codercom/code-server/blob/master/doc/security/ssl.md");
}
if (!options.noAuth) {
if (!options.noAuth && !usingCustomPassword) {
logger.info(" ");
logger.info(`Password:\u001B[1m ${password}`);
} else {