From 2fe2ce2f3aa72c4b1d25a1b41aeb8593c8595a3a Mon Sep 17 00:00:00 2001 From: whoswhip Date: Tue, 30 Dec 2025 11:48:29 -0500 Subject: [PATCH] refactor: streamline user role checks and improve JWT token handling --- .../src/routes/[id]/+page.svelte | 5 +- SharpbinV3/Controllers/PasteController.cs | 34 ++++++++--- SharpbinV3/Program.cs | 49 ++++++++------- SharpbinV3/Services/AuthService.cs | 60 +++++++++---------- 4 files changed, 80 insertions(+), 68 deletions(-) diff --git a/SharpbinV3.Client/src/routes/[id]/+page.svelte b/SharpbinV3.Client/src/routes/[id]/+page.svelte index 040e0ed..10712de 100644 --- a/SharpbinV3.Client/src/routes/[id]/+page.svelte +++ b/SharpbinV3.Client/src/routes/[id]/+page.svelte @@ -523,10 +523,7 @@ Download - {#if $user && ($user.uuid === data.paste?.author?.uuid || ['1', '255'].some( (r) => $user.roles - .toString() - .split(',') - .includes(r) ))} + {#if $user && ($user.uuid === data.paste?.author?.uuid || $user.roles.some((r) => r === 1 || r === 255))} {#if !editing}