From 3ff890d4d1b6f02191fdccf41456c0bbea9d3569 Mon Sep 17 00:00:00 2001 From: Lvyshnevska Date: Mon, 13 Nov 2023 15:03:46 +0100 Subject: [PATCH] bug fixed --- FrontEnd/src/components/ProfileDetail/ProfileDetailPage.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/FrontEnd/src/components/ProfileDetail/ProfileDetailPage.jsx b/FrontEnd/src/components/ProfileDetail/ProfileDetailPage.jsx index d931e2f92..7608825c4 100644 --- a/FrontEnd/src/components/ProfileDetail/ProfileDetailPage.jsx +++ b/FrontEnd/src/components/ProfileDetail/ProfileDetailPage.jsx @@ -10,6 +10,7 @@ import BannerImage from './BannerImage'; import classes from './ProfileDetailPage.module.css'; function ProfileDetailPage({ isAuthorized }) { + const authToken = localStorage.getItem('Token'); const { id } = useParams(); const urlProfile = `${process.env.REACT_APP_BASE_API_URL}/api/profiles/${id}`; @@ -17,8 +18,7 @@ function ProfileDetailPage({ isAuthorized }) { const headers = { 'Content-Type': 'application/json', }; - if (isAuthorized) { - const authToken = localStorage.getItem('Token'); + if (authToken) { headers.Authorization = `Token ${authToken}`; } return fetch(url, {