From a8f9610ec8bc9bcf798e684f71e3062f314e9077 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Fri, 4 Mar 2022 06:52:10 -0800 Subject: [PATCH] Actually fixing that bug this time --- pages/[username].tsx | 6 +++--- pages/teams.tsx | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pages/[username].tsx b/pages/[username].tsx index 8d16dd58..9e8eeaca 100644 --- a/pages/[username].tsx +++ b/pages/[username].tsx @@ -58,13 +58,13 @@ const ProfileRoute: React.FC = () => { } } - const headers = { + const headers = (cookies.account) ? { headers: { 'Authorization': `Bearer ${cookies.account.access_token}` } - } + } : {} - const params = (cookies.account) ? {...filters, ...headers} : filters + const params = {...filters, ...headers} setLoading(true) diff --git a/pages/teams.tsx b/pages/teams.tsx index e81e4cfb..25c5fd12 100644 --- a/pages/teams.tsx +++ b/pages/teams.tsx @@ -51,13 +51,13 @@ const TeamsRoute: React.FC = () => { } } - const headers = { + const headers = (cookies.account) ? { headers: { - 'Authorization': `Bearer ${cookies.account?.access_token}` + 'Authorization': `Bearer ${cookies.account.access_token}` } - } + } : {} - const params = (cookies.account) ? {...filters, ...headers} : filters + const params = {...filters, ...headers} setLoading(true)