diff --git a/Core/Main/PTMagicConfiguration.cs b/Core/Main/PTMagicConfiguration.cs index 3033a40..3931664 100644 --- a/Core/Main/PTMagicConfiguration.cs +++ b/Core/Main/PTMagicConfiguration.cs @@ -84,14 +84,17 @@ namespace Core.Main if (!this.GeneralSettings.Application.ProfitTrailerServerAPIToken.Equals("")) { - result = this.GeneralSettings.Application.ProfitTrailerServerAPIToken.Substring(0, 4); - - for (int i = 1; i < this.GeneralSettings.Application.ProfitTrailerServerAPIToken.Length - 8; i++) + int tokenLength = this.GeneralSettings.Application.ProfitTrailerServerAPIToken.Length; + if (tokenLength == 1) + { + result = "*"; + } + else + result = this.GeneralSettings.Application.ProfitTrailerServerAPIToken.Substring(0, 1); + for (int i = 1; i < this.GeneralSettings.Application.ProfitTrailerServerAPIToken.Length; i++) { result += "*"; } - - result += this.GeneralSettings.Application.ProfitTrailerServerAPIToken.Substring(this.GeneralSettings.Application.ProfitTrailerServerAPIToken.Length - 4); } return result; diff --git a/Monitor/Pages/Login.cshtml.cs b/Monitor/Pages/Login.cshtml.cs index 6958d1a..44c35c5 100644 --- a/Monitor/Pages/Login.cshtml.cs +++ b/Monitor/Pages/Login.cshtml.cs @@ -30,7 +30,8 @@ namespace Monitor.Pages if (encryptedPassword.Equals(PTMagicConfiguration.SecureSettings.MonitorPassword)) { HttpContext.Session.SetString("LoggedIn" + PTMagicConfiguration.GeneralSettings.Monitor.Port.ToString(), DateTime.UtcNow.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fff'Z'")); - + PTMagicConfiguration.GeneralSettings.Monitor.IsPasswordProtected = true; + PTMagicConfiguration.WriteGeneralSettings(); if (cbRememberMe != null) { if (cbRememberMe.Equals("on", StringComparison.InvariantCultureIgnoreCase)) diff --git a/Monitor/Pages/SettingsGeneral.cshtml b/Monitor/Pages/SettingsGeneral.cshtml index 87caf80..168434d 100644 --- a/Monitor/Pages/SettingsGeneral.cshtml +++ b/Monitor/Pages/SettingsGeneral.cshtml @@ -86,7 +86,7 @@