From 3803649d932dd22714fd4ddd78d90fa37a9d4655 Mon Sep 17 00:00:00 2001 From: Xylight Date: Sat, 27 Jul 2024 13:25:03 -0700 Subject: [PATCH] misc: lowercase authoirzation --- src/lib/auth.ts | 6 ++++-- src/lib/lemmy.ts | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lib/auth.ts b/src/lib/auth.ts index efa461d6..c59077b1 100644 --- a/src/lib/auth.ts +++ b/src/lib/auth.ts @@ -154,8 +154,10 @@ export let profile: Readable & { set: (v: Profile) => void } = site.set(res?.site) profile.user = res?.user - profile.avatar = res?.user?.local_user_view.person.avatar - profile.username = res?.user?.local_user_view.person.name + if (profile.user) { + profile.avatar = res?.user?.local_user_view.person.avatar + profile.username = res?.user?.local_user_view.person.name + } fetchUser.loading = false fetchUser.prevProfile = profile.id diff --git a/src/lib/lemmy.ts b/src/lib/lemmy.ts index 91ecbff1..2a723e34 100644 --- a/src/lib/lemmy.ts +++ b/src/lib/lemmy.ts @@ -65,7 +65,7 @@ export function client({ let jwt = auth ? auth : get(profile)?.jwt - let headers = jwt ? { Authorization: `Bearer ${jwt}` } : {} + const headers = jwt ? { authorization: `Bearer ${jwt}` } : {} return new LemmyHttp(instanceToURL(instanceURL), { fetchFunction: (input, init) => customFetch(func, input, init, jwt),