diff --git a/defaults/config.js b/defaults/config.js index 74c071e4..28c05eb5 100644 --- a/defaults/config.js +++ b/defaults/config.js @@ -236,18 +236,21 @@ module.exports = { // // Nick // - // @type string - // @default "lounge-user" + // Percent sign (%) will be replaced into a random number from 0 to 9. + // For example, Guest%%% will become Guest123 on page load. // - nick: "lounge-user", + // @type string + // @default "thelounge%%" + // + nick: "thelounge%%", // // Username // // @type string - // @default "lounge-user" + // @default "thelounge" // - username: "lounge-user", + username: "thelounge", // // Real Name diff --git a/src/server.js b/src/server.js index 3fcc4ffa..fd3e6d8f 100644 --- a/src/server.js +++ b/src/server.js @@ -517,7 +517,7 @@ function getClientConfiguration() { config.themes = themes.getAll(); if (config.displayNetwork) { - config.defaults = Helper.config.defaults; + config.defaults = _.clone(Helper.config.defaults); } else { // Only send defaults that are visible on the client config.defaults = _.pick(Helper.config.defaults, [ @@ -529,6 +529,8 @@ function getClientConfiguration() { ]); } + config.defaults.nick = config.defaults.nick.replace(/%/g, () => Math.floor(Math.random() * 10)); + return config; }