don't send authenticated request when the user is not authenticated
This commit is contained in:
parent
dcb0116c06
commit
54017dbcd9
@ -11,6 +11,8 @@ export const useAuthenticatedFetch = () => {
|
|||||||
body: object | null | undefined = null
|
body: object | null | undefined = null
|
||||||
) => {
|
) => {
|
||||||
const accessToken = await getToken();
|
const accessToken = await getToken();
|
||||||
|
if (!accessToken) return;
|
||||||
|
|
||||||
const headers: HeadersInit = {
|
const headers: HeadersInit = {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
Authorization: `Bearer ${accessToken}`,
|
Authorization: `Bearer ${accessToken}`,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user