diff --git a/PasteBin/Program.cs b/PasteBin/Program.cs index 8908582..9716569 100644 --- a/PasteBin/Program.cs +++ b/PasteBin/Program.cs @@ -5,6 +5,7 @@ using Newtonsoft.Json.Linq; using System.Data; using System.Text; using Sharpbin; +using System.Reflection; class Program { @@ -2296,6 +2297,7 @@ class Program await context.Response.WriteAsJsonAsync(new JObject { ["error"] = "Unauthorized" }.ToString()); return; } + var user = await GetLoggedInUserAsync(token); if (user == null) { @@ -2304,6 +2306,13 @@ class Program await context.Response.WriteAsJsonAsync(new JObject { ["error"] = "Unauthorized" }.ToString()); return; } + if (user.UUID == null) + { + context.Response.StatusCode = 401; + context.Response.ContentType = "application/json"; + await context.Response.WriteAsJsonAsync(new JObject { ["error"] = "Unauthorized" }.ToString()); + return; + } var responseJson = new JObject(); responseJson["message"] = "Authenticated"; @@ -2317,7 +2326,7 @@ class Program context.Response.StatusCode = 200; context.Response.ContentType = "application/json"; - await context.Response.WriteAsJsonAsync(responseJson.ToString()); + await context.Response.WriteAsJsonAsync(responseJson); })); #endregion diff --git a/PasteBin/assets/paste.html b/PasteBin/assets/paste.html index f8edb0b..f72f589 100644 --- a/PasteBin/assets/paste.html +++ b/PasteBin/assets/paste.html @@ -32,8 +32,9 @@
-

-

+

+

+

@@ -47,6 +48,18 @@
+
+
+
+

+ Are you sure you want to delete this paste? +

+
+ + +
+
+
@@ -160,6 +227,30 @@ + + @keyframes hoverup { + 0% { + opacity: 0; + transform: translateY(100%); + } + + 25% { + opacity: 1; + } + + 50% { + + transform: translateY(-10px); + } + + 100% { + opacity: 1; + transform: translateY(0); + } + } + + @keyframes hoverdown { + 0% { + transform: translateY(0); + } + + 50% { + transform: translateY(-10px); + } + + 100% { + transform: translateY(200%); + } + + } + + .notification-div { + display: flex; + right: 0; + bottom: 0; + width: fit-content; + height: fit-content; + color: white; + background-color: #181818; + border-radius: 5px; + border: #222222 2px solid; + padding-left: 10px; + padding-right: 10px; + margin-right: 10px; + margin-bottom: 10px; + justify-content: center; + align-items: center; + } + \ No newline at end of file diff --git a/PasteBin/assets/privatepaste.html b/PasteBin/assets/privatepaste.html index f25b4a8..aa737d1 100644 --- a/PasteBin/assets/privatepaste.html +++ b/PasteBin/assets/privatepaste.html @@ -17,7 +17,8 @@