mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-06 02:48:43 +00:00
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:
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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}`);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user