From f643956e855943b021f2db527547972ffcd24daf Mon Sep 17 00:00:00 2001 From: James Xylight Date: Wed, 3 Sep 2025 21:13:27 -0700 Subject: [PATCH] sec: remove auth for other logins --- src/lib/client/README | 1 - src/lib/lemmy.svelte.ts | 8 ++++++-- src/style/app.css | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) delete mode 100644 src/lib/client/README diff --git a/src/lib/client/README b/src/lib/client/README deleted file mode 100644 index fe092b44..00000000 --- a/src/lib/client/README +++ /dev/null @@ -1 +0,0 @@ -A lot of the code in here was either inspired or modified from https://github.com/aeharding/threadiverse, which is licensed under the AGPL 3.0. \ No newline at end of file diff --git a/src/lib/lemmy.svelte.ts b/src/lib/lemmy.svelte.ts index 632ac4f4..a4eef268 100644 --- a/src/lib/lemmy.svelte.ts +++ b/src/lib/lemmy.svelte.ts @@ -63,8 +63,11 @@ export function client({ if (!instanceURL) instanceURL = profile.current.instance || DEFAULT_INSTANCE_URL - const jwt = auth ? auth : profile.current?.jwt + // we use nullish coealsiaihsa something so that + // we can set auth = '' to remove it + const jwt = auth ?? profile.current?.jwt + // but not here, so that if jwt == '', it doesnt put a bearer const headers = jwt ? { authorization: `Bearer ${jwt}` } : {} return new LemmyHttp(instanceToURL(instanceURL), { @@ -74,6 +77,7 @@ export function client({ }) } +// here for parts where i forgor to switch export function getClient( instanceURL?: string, func?: ( @@ -89,7 +93,7 @@ export async function validateInstance(instance: string): Promise { if (instance == '') return false try { - await getClient(instance).getSite() + await client({ instanceURL: instance, auth: '' }).getSite() return true } catch { diff --git a/src/style/app.css b/src/style/app.css index 5b210d37..626ba25e 100644 --- a/src/style/app.css +++ b/src/style/app.css @@ -11,7 +11,7 @@ --font-display: Inter, system-ui, sans-serif; --font-mono: monospace; - --animate-pop-in: pop-in 0.8s cubic-bezier(0.075, 0.82, 0.165, 1); + --animate-pop-in: pop-in 0.8s cubic-bezier(0.075, 0.82, 0.165, 1) forwards; --ease-cubic: cubic-bezier(0.075, 0.82, 0.165, 1); --spacing-22: 88px;