From ade64446dc4a2f00dd4a873d8cb2b9279b60e73c Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Tue, 31 Jan 2023 02:56:42 -0800 Subject: [PATCH] Unset edit key on page load Just in case, we're unsetting the edit key on page load, so that we can re-set it after clearing our logic checks --- components/Party/index.tsx | 2 ++ utils/userToken.tsx | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/components/Party/index.tsx b/components/Party/index.tsx index 1daf7c9b..347bc49e 100644 --- a/components/Party/index.tsx +++ b/components/Party/index.tsx @@ -1,4 +1,5 @@ import React, { useEffect, useState } from 'react' +import { getCookie } from 'cookies-next' import { useRouter } from 'next/router' import { useSnapshot } from 'valtio' import clonedeep from 'lodash.clonedeep' @@ -61,6 +62,7 @@ const Party = (props: Props) => { : null let editable = false + unsetEditKey() if (props.new) editable = true diff --git a/utils/userToken.tsx b/utils/userToken.tsx index e75429ff..08563bda 100644 --- a/utils/userToken.tsx +++ b/utils/userToken.tsx @@ -29,7 +29,6 @@ export const setHeaders = ( export const setEditKey = (id: string, user?: User) => { if (!user) { const edit_key = get(id) - console.log('Setting header...', edit_key) axios.defaults.headers.common['X-Edit-Key'] = edit_key } else { unsetEditKey()