From 65ddb4b7220d9c4e091cfac6c3983c26f81d7078 Mon Sep 17 00:00:00 2001 From: whoswhip Date: Fri, 13 Sep 2024 11:54:04 -0400 Subject: [PATCH] Remove debug prints and refactor notification function Removed unnecessary console output in Program.cs and Turnstile.cs to clean up logs and avoid exposing sensitive information. Refactored user.html to replace the `notification` function with `createNotification` for improved notification handling. --- PasteBin/Program.cs | 1 - PasteBin/Turnstile.cs | 1 - PasteBin/assets/admin/user.html | 12 ++++++------ 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/PasteBin/Program.cs b/PasteBin/Program.cs index 90e8acb..d57e947 100644 --- a/PasteBin/Program.cs +++ b/PasteBin/Program.cs @@ -1239,7 +1239,6 @@ class Program { newPassword = GenerateRandomPassword(50); } - Console.WriteLine(newPassword); if (string.IsNullOrEmpty(uuid) || string.IsNullOrWhiteSpace(uuid)) { context.Response.StatusCode = 400; diff --git a/PasteBin/Turnstile.cs b/PasteBin/Turnstile.cs index 29baae6..d253d60 100644 --- a/PasteBin/Turnstile.cs +++ b/PasteBin/Turnstile.cs @@ -24,7 +24,6 @@ namespace Sharpbin using (var response = await httpClient.SendAsync(request)) { var jsonresponse = JObject.Parse(await response.Content.ReadAsStringAsync()); - Console.WriteLine(jsonresponse["success"]?.ToString()); if (jsonresponse["success"]?.ToString().ToLower() == "true") { return true; diff --git a/PasteBin/assets/admin/user.html b/PasteBin/assets/admin/user.html index feb19e3..151a05f 100644 --- a/PasteBin/assets/admin/user.html +++ b/PasteBin/assets/admin/user.html @@ -133,11 +133,11 @@ date = new Date(date).getTime() / 1000; let reason = document.getElementById('ban-reason').value; if (date == null || reason == null) { - notification('Please fill out all fields'); + createNotification('Please fill out all fields'); return; } if (date < new Date().getTime() / 1000) { - notification('Please select a date in the future'); + createNotification('Please select a date in the future'); return; } if ('{typeban}' == 'unban') { @@ -155,9 +155,9 @@ .then(obj => { const result = JSON.parse(obj); if (result.message != null) { - notification(`${result.message} for ${reason}`); + createNotification(`${result.message} for ${reason}`); } else { - notification(`Failed to {typeban} ${result.error}`); + createNotification(`Failed to {typeban} ${result.error}`); } }) } else { @@ -176,9 +176,9 @@ .then(obj => { const result = JSON.parse(obj); if (result.message != null) { - notification(`${result.message} for ${reason}`); + createNotification(`${result.message} for ${reason}`); } else { - notification(`Failed to {typeban} ${result.error}`); + createNotification(`Failed to {typeban} ${result.error}`); } }) }