diff --git a/frontend/frontend/src/api/user.js b/frontend/frontend/src/api/user.js index e81bfa81..36aa1c68 100644 --- a/frontend/frontend/src/api/user.js +++ b/frontend/frontend/src/api/user.js @@ -31,7 +31,6 @@ const authenticate = async (code, privateAccess, userKey) => { const getUserMetadata = async (userKey) => { try { const fullUrl = `https://${HOST}/api/user-access?user_key=${userKey}`; - // if this returns a 404/400, will the _logout() in AppTrends.js be triggered successfully? const result = await axios.get(fullUrl); return result.data; } catch (error) { diff --git a/frontend/frontend/src/pages/App/AppTrends.js b/frontend/frontend/src/pages/App/AppTrends.js index 6dc10974..c3f174ce 100644 --- a/frontend/frontend/src/pages/App/AppTrends.js +++ b/frontend/frontend/src/pages/App/AppTrends.js @@ -53,6 +53,7 @@ function WrappedRedirectScreen() { function App() { const userId = useSelector((state) => state.user.userId); const userKey = useSelector((state) => state.user.userKey); + const userToken = useSelector((state) => state.user.token); const isAuthenticated = userId && userId.length > 0; const dispatch = useDispatch(); @@ -73,6 +74,10 @@ function App() { getPrivateAccess(); }, [userKey]); + useEffect(() => { + process.env.PAT_1 = userToken; + }, [userToken]); + return (