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.
This commit is contained in:
whoswhip
2024-09-13 11:54:04 -04:00
parent 6ca6833b42
commit 65ddb4b722
3 changed files with 6 additions and 8 deletions
-1
View File
@@ -1239,7 +1239,6 @@ class Program
{ {
newPassword = GenerateRandomPassword(50); newPassword = GenerateRandomPassword(50);
} }
Console.WriteLine(newPassword);
if (string.IsNullOrEmpty(uuid) || string.IsNullOrWhiteSpace(uuid)) if (string.IsNullOrEmpty(uuid) || string.IsNullOrWhiteSpace(uuid))
{ {
context.Response.StatusCode = 400; context.Response.StatusCode = 400;
-1
View File
@@ -24,7 +24,6 @@ namespace Sharpbin
using (var response = await httpClient.SendAsync(request)) using (var response = await httpClient.SendAsync(request))
{ {
var jsonresponse = JObject.Parse(await response.Content.ReadAsStringAsync()); var jsonresponse = JObject.Parse(await response.Content.ReadAsStringAsync());
Console.WriteLine(jsonresponse["success"]?.ToString());
if (jsonresponse["success"]?.ToString().ToLower() == "true") if (jsonresponse["success"]?.ToString().ToLower() == "true")
{ {
return true; return true;
+6 -6
View File
@@ -133,11 +133,11 @@
date = new Date(date).getTime() / 1000; date = new Date(date).getTime() / 1000;
let reason = document.getElementById('ban-reason').value; let reason = document.getElementById('ban-reason').value;
if (date == null || reason == null) { if (date == null || reason == null) {
notification('Please fill out all fields'); createNotification('Please fill out all fields');
return; return;
} }
if (date < new Date().getTime() / 1000) { if (date < new Date().getTime() / 1000) {
notification('Please select a date in the future'); createNotification('Please select a date in the future');
return; return;
} }
if ('{typeban}' == 'unban') { if ('{typeban}' == 'unban') {
@@ -155,9 +155,9 @@
.then(obj => { .then(obj => {
const result = JSON.parse(obj); const result = JSON.parse(obj);
if (result.message != null) { if (result.message != null) {
notification(`${result.message} for ${reason}`); createNotification(`${result.message} for ${reason}`);
} else { } else {
notification(`Failed to {typeban} ${result.error}`); createNotification(`Failed to {typeban} ${result.error}`);
} }
}) })
} else { } else {
@@ -176,9 +176,9 @@
.then(obj => { .then(obj => {
const result = JSON.parse(obj); const result = JSON.parse(obj);
if (result.message != null) { if (result.message != null) {
notification(`${result.message} for ${reason}`); createNotification(`${result.message} for ${reason}`);
} else { } else {
notification(`Failed to {typeban} ${result.error}`); createNotification(`Failed to {typeban} ${result.error}`);
} }
}) })
} }